Skip to content

Forw/Back operations for Convolutional Neural Networks

License

Notifications You must be signed in to change notification settings

kuruonur1/CNN.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CNN

CNN provides convolution/pooling forward/backward operations to train a Convolutional Neural Network (CNN) on CPU. It utilizes parallel matrix multiplications (gemm) for speed up and has full support for any stride and padding size. The module serves as the backbone to power up CNNs and has similar interface to CUDNN.jl.

Convolution

  • x: (Wx,Hx,C,N)
  • w: (Ww,Hw,C,K)
  • y: (Wy,Hy,K,N)

convolutionForward(x, w, y; padding=(0,0), stride=(1,1)) This function computes and returns y, the convolution of x with filter (w) under the settings (padding=(p1,p2), stride=(s1,s2)). The settings default to (padding=(0,0), stride=(1,1)).

convolutionBackwardFilter(x, dy, dw; padding=(0,0), stride=(1,1)) Given x and dJ/dy (abbrev. dy: derivative with respect to the output), this function computes and returns dJ/dw (abbrev. dw: derivative with respect to the filter). Notice that forward and backward settings must match for consistency.

convolutionBackwardData(w, dy, dx; padding=(0,0), stride=(1,1)) Given w and dJ/dy, this function computes and returns dJ/dx (abbrev. dx: derivative with respect to input).

Pooling

poolingForward(x, y; window=(2,2), padding=(0,0), stride=window) Performs the pooling operation on x specified by (window, padding, stride).

poolingBackward(y, dy, x, dx; window=(2,2), padding=(0,0), stride=window) This function computes and returns dJ/dx (abbrev. dx) where x is the input and y is the output of forward pooling operation, dJ/dy (abbrev. dy) is the loss gradient.

About

Forw/Back operations for Convolutional Neural Networks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages