MCPcopy
hub / github.com/ddbourgin/numpy-ml / CD_update

Method CD_update

numpy_ml/neural_nets/layers/layers.py:452–466  ·  view source on GitHub ↗

Perform a single contrastive divergence-`k` training update using the visible inputs `X` as a starting point for the Gibbs sampler. Parameters ---------- X : :py:class:`ndarray ` of shape `(n_ex, n_in)` Layer input, representing th

(self, X)

Source from the content-addressed store, hash-verified

450 }
451
452 def CD_update(self, X):
453 """
454 Perform a single contrastive divergence-`k` training update using the
455 visible inputs `X` as a starting point for the Gibbs sampler.
456
457 Parameters
458 ----------
459 X : :py:class:`ndarray <numpy.ndarray>` of shape `(n_ex, n_in)`
460 Layer input, representing the `n_in`-dimensional features for a
461 minibatch of `n_ex` examples. Each feature in X should ideally be
462 binary-valued, although it is possible to also train on real-valued
463 features ranging between (0, 1) (e.g., grayscale images).
464 """
465 self.forward(X)
466 self.backward()
467
468 def forward(self, V, K=None, retain_derived=True):
469 """

Callers

nothing calls this directly

Calls 2

forwardMethod · 0.95
backwardMethod · 0.95

Tested by

no test coverage detected