August 2019
Intermediate to advanced
242 pages
5h 45m
English
Of course, being able to add to numbers isn't why we're here; we're here to work with tensors, and eventually, DL equations, so let's take the first step toward something a little more complicated.
The goal here is to now create a graph that will compute the following simple equation:
z = Wx
Note that W is an n x n matrix, and x is a vector of size n. For the purposes of this example, we will use n = 2.1957.
Again, we start with the same basic main function, as shown here:
package mainimport ( "fmt" "log" G "gorgonia.org/gorgonia" "gorgonia.org/tensor")func main() { g := NewGraph()}
You'll notice that we've chosen to alias the Gorgonia package as G.
We then create our first tensor, the matrix, W, like so:
matB := []float64{0.9,0.7,0.4,0.2} ...Read now
Unlock full access