August 2019
Intermediate to advanced
242 pages
5h 45m
English
As this is an autoencoder, the first step is to build the encoding portion, which will look something like this:

First, we have our two fully connected layers:
w0 := gorgonia.NewMatrix(g, dt, gorgonia.WithShape(784, 256), gorgonia.WithName("w0"), gorgonia.WithInit(gorgonia.GlorotU(1.0)))w1 := gorgonia.NewMatrix(g, dt, gorgonia.WithShape(256, 128), gorgonia.WithName("w1"), gorgonia.WithInit(gorgonia.GlorotU(1.0)))
We give each layer a ReLU activation:
// Set first layer to be copy of inputl0 = xlog.Printf("l0 shape %v", l0.Shape())// Encoding - Part 1if c1, err = gorgonia.Mul(l0, m.w0); err != nil { return errors.Wrap(err, "Layer 1 ...Read now
Unlock full access