Building an RBM in Gorgonia

Now that we've cleaned up our data, created a training or test set, and written the code necessary to produce the input required by our network, we can begin coding up the RBM itself.

First, we begin with our now standard struct, the scaffold onto which we attach the various components of our network:

const cdS = 1type ggRBM struct {    g *ExprGraph    v *Node // visible units    vB *Node // visible unit biases - same size tensor as v    h *Node // hidden units    hB *Node // hidden unit biases - same size tensor as h    w *Node // connection weights    cdSamples int // number of samples for contrastive divergence - WHAT ABOUT MOMENTUM}func (m *ggRBM) learnables() Nodes {    return Nodes{m.w, m.vB, m.hB}}

Then, we add the helper functions ...

Get Hands-On Deep Learning with Go now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.