## 3 Materials and Methods
### Unsupervised Models
The conditional probabilities follow the following equations:  
\[p(\mathbf{v}|\mathbf{h})=N\Big{(}\mathbf{v}|\mathbf{b}+\sum_{j}h_{j}w_{ij}, \Sigma^{2}\Big{)}, \tag{6}\]  
\[p(\mathbf{h}|\mathbf{v})=N\Big{(}\mathbf{h}|\mathbf{c}+\sum_{i}v_{i}w_{ij},S^ {2}\Big{)} \tag{7}\]  
where \(N(\mu,\Sigma)\) represents the multivariate normal distribution with mean \(\mu\) and covariance \(\Sigma\), respectively. We denote \(\Sigma^{2}\) and \(S^{2}\) as the covariance matrix of the visible and hidden units. It must be satisfied that \(S\) is an \(N\times N\) matrix where the diagonal of \(S\) is \(\text{diag}(s_{1},\ldots,s_{N})\), satisfying that \(S_{jj}=s_{j}\) and \(S_{ij}=0\). For the matrix \(\Sigma\), it is a matrix of \(M\times M\) whose diagonal is \(\text{diag}(\sigma_{1},\ldots,\sigma_{m})\). In the GGRBM model, the conditional distributions over visible and hidden units require predefined covariance matrices \(\Sigma\) and \(S\), respectively. Rather than learning these variances jointly with the weights--which can lead to convergence issues and increased model complexity--we adopted an empirical strategy inspired by [64; 65]. Specifically, (a) the covariance matrix of the visible units, \(\Sigma\), is fixed using the empirical covariance of the training data, and (b) the covariance matrix of the hidden units, \(\lx@sectionsign\), is set as a scaled identity matrix \(S=sI_{m}\), assuming statistical independence between hidden units. We found that setting \(s=0.5\) resulted in the most stable convergence behavior. Larger values tended to produce instability or divergent learning dynamics. Similar behavior was reported in [66], who noted that tuning variance parameters--especially in Gaussian-Bernoulli and Gaussian-Gaussian configurations--requires particular care to avoid learning divergence and unreliable sampling. To estimate the set of model parameters, i.e., \(\mathbf{b},\mathbf{c}\) and \(\mathbf{W}\), we can use the contrastive divergence (CD) learning [62] approach that has been the standard for training RBMs. Learning via CD takes \(k\) steps to approximate the second term of the gradient of the log-likelihood function by sampling from the RBM distribution. Following the literature notation in RBM, we express expectation under the data distribution as \(\langle.\rangle_{d}\) using \(k\) steps of Gibbs samplings, and the expectation under the model distribution as \(\langle.\rangle_{m}\), which we call the expected gradients of the positive and negative phases, respectively. The parameter update rules are as follows:  
\[\Delta w_{ij}=\Big{\langle}\frac{v_{i}}{\sigma_{i}^{2}}\frac{h_{j}}{s_{j}^{2}} \Big{\rangle}_{d}-\Big{\langle}\frac{v_{i}}{\sigma_{i}^{2}}\frac{h_{j}}{s_{j}^ {2}}\Big{\rangle}_{m} \tag{8}\]  
\[\Delta b_{i}=\Big{\langle}\frac{v_{i}}{\sigma_{i}^{2}}\Big{\rangle}_{d}-\Big{ \langle}\frac{v_{i}}{\sigma_{i}^{2}}\Big{\rangle}_{m} \tag{9}\]  
\[\Delta w_{ij}=\Big{\langle}\frac{h_{j}}{s_{j}^{2}}\Big{\rangle}_{d}-\Big{\langle} \frac{h_{j}}{s_{j}^{2}}\Big{\rangle}_{m} \tag{10}\]Note that the values of \(\sigma_{i}\) and \(s_{j}\) are meaningful only for the GGRBM, and for the BBRBM case, we can leave them equal to 1. The negative phase estimation process can be carried out with only the \(k=1\) step of Gibbs. However, we opted for using Persistent Contrastive Divergence (PCD) [67] as the training method for both the Bernoulli-Bernoulli RBM (BBRBM) and the Gaussian-Gaussian RBM (GGRBM). While traditional Contrastive Divergence (CD-k) starts the Markov chain at the data point for every gradient update, PCD maintains a persistent chain of _fantasy particles_ across iterations. This allows the persistent samples to reflect the model's evolving distribution more accurately, leading to better mixing and potentially improved feature detectors. This modification has been shown to improve the estimation of the model's expectation over the data distribution, especially when the model is still far from convergence [68; 69; 70; 71].