November 2018
Beginner to intermediate
348 pages
8h 32m
English
For the convnet to learn, what is required is backpropagation, which propagates the errors, and a gradient descent function to update the weight matrices. To do this is relatively simple with Gorgonia, so simple that we can actually put it into our main function without impacting understandability:
func main() { flag.Parse() parseDtype() imgs, err := readImageFile(os.Open("train-images-idx3-ubyte")) if err != nil { log.Fatal(err) } labels, err := readLabelFile(os.Open("train-labels-idx1-ubyte")) if err != nil { log.Fatal(err) } inputs := prepareX(imgs) targets := prepareY(labels) // the data is in (numExamples, 784). // In order to use a convnet, we need to massage the data // into this format (batchsize, numberOfChannels, ...Read now
Unlock full access