Running the neural network

Observe that up to this point, we've merely described the computations we need to perform. The neural network doesn't actually run; this is simply a description on the neural network to run.

We need to be able to evaluate the mathematical expression. In order to do so, we need to compile the expression into a program that can be executed. Here's the code to do it:

    vm := gorgonia.NewTapeMachine(g,         gorgonia.WithPrecompiled(prog, locMap),         gorgonia.BindDualValues(m.learnables()...))    solver := gorgonia.NewRMSPropSolver(gorgonia.WithBatchSize(float64(bs)))    defer vm.Close()

It's not strictly necessary to call gorgonia.Compile(g). This was done for pedagogical reasons, to showcase that the mathematical expression can ...

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.