August 2019
Intermediate to advanced
242 pages
5h 45m
English
If you've completed all the previous steps to get CUDA working, then using CUDA is a fairly simple affair. You simply need to compile your application with the following:
go build -tags='cuda'
This builds your executable with CUDA support and uses CUDA, rather than the CPU, to run your deep learning model.
To illustrate, let's use an example we're already familiar with – a neural network with weights:
w0 := gorgonia.NewMatrix(g, dt, gorgonia.WithShape(784, 300), gorgonia.WithName("w0"), gorgonia.WithInit(gorgonia.GlorotN(1.0)))w1 := gorgonia.NewMatrix(g, dt, gorgonia.WithShape(300, 100), gorgonia.WithName("w1"), gorgonia.WithInit(gorgonia.GlorotN(1.0)))w2 := gorgonia.NewMatrix(g, dt, gorgonia.WithShape(100, 10), gorgonia.WithName("w2"), ...Read now
Unlock full access