
Restricted Boltzmann machine (contrastive divergence)
Source:R/esl_native2.R
morie_esl_boltzmann.Rd"Restricted" means no within-layer edges, so the conditionals factorise and
block Gibbs sampling is cheap. The partition function is a sum over all
2^(|v| + |h|) configurations and is intractable, so the likelihood
gradient cannot be computed; CD-k substitutes a k-step chain started at the
data.
Usage
morie_esl_boltzmann(
v,
h = 4L,
lr = 0.1,
n_epochs = 200L,
k_cd = 1L,
seed = 0L,
batch_size = NULL
)Value
List with W, a, b, hidden_prob, reconstruction,
reconstruction_error, error_path, free_energy.
Details
That makes this a biased gradient of an approximate objective, not the
likelihood – so NO log-likelihood is reported. reconstruction_error is
reported instead, with the caveat that it can fall while the model gets
worse, which is why RBM training is judged by samples.