gorgonia.org/gorgonia@v0.9.17/ops/nn/api_nocuda.go (about) 1 // +build !cuda 2 3 package nnops 4 5 import ( 6 G "gorgonia.org/gorgonia" 7 "gorgonia.org/tensor" 8 ) 9 10 func Conv2d(im, filter *G.Node, kernelShape tensor.Shape, pad, stride, dilation []int) (retVal *G.Node, err error) { 11 return G.Conv2d(im, filter, kernelShape, pad, stride, dilation) 12 } 13 14 func Conv1d(in, filter *G.Node, kernel, pad, stride, dilation int) (*G.Node, error) { 15 return Conv2d(in, filter, tensor.Shape{1, kernel}, []int{0, pad}, []int{1, stride}, []int{1, dilation}) 16 } 17 18 func MaxPool2D(x *G.Node, kernel tensor.Shape, pad, stride []int) (*G.Node, error) { 19 return G.MaxPool2D(x, kernel, pad, stride) 20 } 21 22 func Dropout(x *G.Node, prob float64) (retVal *G.Node, err error) { 23 return G.Dropout(x, prob) 24 } 25 26 func Rectify(x *G.Node) (retVal *G.Node, err error) { 27 return G.Rectify(x) 28 } 29 30 func BatchNorm(x, scale, bias *G.Node, momentum, epsilon float64) (retVal, γ, β *G.Node, op *G.BatchNormOp, err error) { 31 return G.BatchNorm(x, scale, bias, momentum, epsilon) 32 }