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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.