MagmaDNN  1.0
c++NeuralNetworkFramework
conv2dlayer.h File Reference
#include <vector>
#include "layer/layer.h"
#include "tensor/tensor.h"
#include "compute/operation.h"
#include "compute/variable.h"
#include "compute/conv2dforward/conv2dforwardop.h"
Include dependency graph for conv2dlayer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  magmadnn::layer::Conv2dLayer< T >
 

Enumerations

enum  padding_t { SAME, VALID }
 

Functions

template<typename T >
Conv2dLayer< T > * magmadnn::layer::conv2d (op::Operation< T > *input, const std::vector< unsigned int > &filter_shape, int out_channels, const std::vector< unsigned int > &padding, const std::vector< unsigned int > &strides, const std::vector< unsigned int > &dilation_rates, bool use_cross_correlation, bool use_bias, tensor_filler_t< T > filter_initializer, tensor_filler_t< T > bias_initializer)
 
template<typename T >
Conv2dLayer< T > * magmadnn::layer::conv2d (op::Operation< T > *input, const std::vector< unsigned int > &filter_shape, int out_channels, padding_t padding, const std::vector< unsigned int > &strides, const std::vector< unsigned int > &dilation_rates, bool use_cross_correlation, bool use_bias, tensor_filler_t< T > filter_initializer, tensor_filler_t< T > bias_initializer)
 

Detailed Description

Author
Daniel Nichols
Version
1.0
Date
2019-07-08

Function Documentation

◆ conv2d()

template<typename T >
Conv2dLayer< T > * magmadnn::layer::conv2d ( op::Operation< T > *  input,
const std::vector< unsigned int > &  filter_shape = {3, 3},
int  out_channels = 1,
const std::vector< unsigned int > &  padding = {0, 0},
const std::vector< unsigned int > &  strides = {1, 1},
const std::vector< unsigned int > &  dilation_rates = {1, 1},
bool  use_cross_correlation = true,
bool  use_bias = false,
tensor_filler_t< T >  filter_initializer = {GLOROT,{0.0, 0.2f}},
tensor_filler_t< T >  bias_initializer = {GLOROT,{0.0, 0.2f}} 
)

Create a Conv2d Layer. Computes the output on the GPU. Uses CuDNN. No host functionality.

Template Parameters
Tnumeric
Parameters
inputthe input data; must be a 4D tensor in format NCHW (N-batch, C-Channel, H-height, W-Width)
filter_shapeshape of the convolution kernel. must be a 2 dimensional vector; defaults to {3,3}
out_channelsnumber of output filters; defaults to 1
paddingthe padding size to use. must be a two dimensional vector; defaults to {0,0}
stridesstriding of convolution. must be a two dimensional vector; defaults to {1,1}
dilation_ratesrate of dilation. must be a two dimensional vector; defaults to {1,1}
use_cross_correlationwhether to do a cross correlation convolution or standard convolution; defaults to cross correlation
use_biasuse convolutional bias or not; defaults to false
filter_initializerhow to initialize the filter tensor; defaults to {GLOROT,{0.0f,0.2f}}
bias_initializerhow to initialize the bias tensor; defaults to {GLOROT, {0.0f,0.2f}}
Returns
Conv2dLayer<T>* a new layer