Describing a neural network

Now let's get back to the task of writing a neural network and thinking of it in terms of a mathematical expression expressed as a graph. Recall that the code looks something like this:

import (  G "gorgonia.org/gorgonia")var Float tensor.Float = tensor.Float64func main() {  g := G.NewGraph()  x := G.NewMatrix(g, Float, G.WithName("x"), G.WithShape(N, 728))  w := G.NewMatrix(g, Float, G.WithName("w"), G.WithShape(728, 800),                    G.WithInit(G.Uniform(1.0)))  b := G.NewMatrix(g, Float, G.WithName("b"), G.WithShape(N, 800),                    G.WithInit(G.Zeroes()))  xw, _ := G.Mul(x, w)  xwb, _ := G.Add(xw, b)  act, _ := G.Sigmoid(xwb)  w2 := G.NewMatrix(g, Float, G.WithName("w2"), G.WithShape(800, 10),                     G.WithInit(G.Uniform(1.0))) b2 := G.NewMatrix(g, ...

Get Go Machine Learning Projects 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.