MachineIntelligenceCore:NeuralNets
|
#include <Layer.hpp>
Public Member Functions | |
Layer (size_t input_height_, size_t input_width_, size_t input_depth_, size_t output_height_, size_t output_width_, size_t output_depth_, LayerTypes layer_type_, std::string name_="layer") | |
virtual | ~Layer () |
virtual void | forward (bool test=false)=0 |
mic::types::MatrixPtr< eT > | forward (mic::types::MatrixPtr< eT > x_, bool test=false) |
virtual void | backward ()=0 |
mic::types::MatrixPtr< eT > | backward (mic::types::MatrixPtr< eT > dy_) |
virtual void | resizeBatch (size_t batch_size_) |
template<typename loss > | |
mic::types::MatrixPtr< eT > | calculateNumericalGradient (mic::types::MatrixPtr< eT > x_, mic::types::MatrixPtr< eT > target_y_, mic::types::MatrixPtr< eT > param_, loss loss_, eT delta_) |
virtual void | resetGrads () |
virtual void | update (eT alpha_, eT decay_=0.0f)=0 |
size_t | inputSize () |
Returns size (length) of inputs. More... | |
size_t | outputSize () |
Returns size (length) of outputs. More... | |
size_t | batchSize () |
Returns size (length) of (mini)batch. More... | |
const std::string | name () const |
Returns name of the layer. More... | |
mic::types::MatrixPtr< eT > | getParam (std::string name_) |
mic::types::MatrixPtr< eT > | getState (std::string name_) |
mic::types::MatrixPtr< eT > | getGradient (std::string name_) |
void | setState (std::string name_, mic::types::MatrixPtr< eT > mat_ptr_) |
template<typename omT > | |
void | setOptimization () |
const std::string | type () const |
virtual std::string | streamLayerParameters () |
mic::types::MatrixPtr< eT > | lazyReturnSampleFromBatch (mic::types::MatrixPtr< eT > batch_ptr_, mic::types::MatrixArray< eT > &array_, std::string id_, size_t sample_number_, size_t sample_size_) |
mic::types::MatrixPtr< eT > | lazyReturnInputSample (mic::types::MatrixPtr< eT > batch_ptr_, size_t sample_number_) |
mic::types::MatrixPtr< eT > | lazyReturnOutputSample (mic::types::MatrixPtr< eT > batch_ptr_, size_t sample_number_) |
mic::types::MatrixPtr< eT > | lazyReturnChannelFromSample (mic::types::MatrixPtr< eT > sample_ptr_, mic::types::MatrixArray< eT > &array_, std::string id_, size_t sample_number_, size_t channel_number_, size_t height_, size_t width_) |
mic::types::MatrixPtr< eT > | lazyReturnInputChannel (mic::types::MatrixPtr< eT > sample_ptr_, size_t sample_number_, size_t channel_number_) |
mic::types::MatrixPtr< eT > | lazyReturnOutputChannel (mic::types::MatrixPtr< eT > sample_ptr_, size_t sample_number_, size_t channel_number_) |
void | lazyAllocateMatrixVector (std::vector< std::shared_ptr< mic::types::Matrix< eT > > > &vector_, size_t vector_size_, size_t matrix_height_, size_t matrix_width_) |
virtual std::vector < std::shared_ptr < mic::types::Matrix< eT > > > & | getInputActivations () |
virtual std::vector < std::shared_ptr < mic::types::Matrix< eT > > > & | getInputGradientActivations () |
virtual std::vector < std::shared_ptr < mic::types::Matrix< eT > > > & | getOutputActivations () |
virtual std::vector < std::shared_ptr < mic::types::Matrix< eT > > > & | getOutputGradientActivations () |
Protected Member Functions | |
Layer () | |
Protected Attributes | |
size_t | input_height |
Height of the input (e.g. 28 for MNIST). More... | |
size_t | input_width |
Width of the input (e.g. 28 for MNIST). More... | |
size_t | input_depth |
Number of channels of the input (e.g. 3 for RGB images). More... | |
size_t | output_height |
Number of receptive fields in a single channel - vertical direction. More... | |
size_t | output_width |
Number of receptive fields in a single channel - horizontal direction. More... | |
size_t | output_depth |
Number of filters = number of output channels. More... | |
size_t | batch_size |
Size (length) of (mini)batch. More... | |
LayerTypes | layer_type |
Type of the layer. More... | |
std::string | layer_name |
Name (identifier of the type) of the layer. More... | |
mic::types::MatrixArray< eT > | s |
States - contains input [x] and output [y] matrices. More... | |
mic::types::MatrixArray< eT > | g |
Gradients - contains input [x] and output [y] matrices. More... | |
mic::types::MatrixArray< eT > | p |
Parameters - parameters of the layer, to be used by the derived classes. More... | |
mic::types::MatrixArray< eT > | m |
Memory - a list of temporal parameters, to be used by the derived classes. More... | |
mic::neural_nets::optimization::OptimizationArray < eT > | opt |
Array of optimization functions. More... | |
std::vector< std::shared_ptr < mic::types::Matrix< eT > > > | x_activations |
Vector containing activations of input neurons - used in visualization. More... | |
std::vector< std::shared_ptr < mic::types::Matrix< eT > > > | dx_activations |
Vector containing activations of gradients of inputs (dx) - used in visualization. More... | |
std::vector< std::shared_ptr < mic::types::Matrix< eT > > > | y_activations |
Vector containing activations of output neurons - used in visualization. More... | |
std::vector< std::shared_ptr < mic::types::Matrix< eT > > > | dy_activations |
Vector containing activations of gradients of outputs (dy) - used in visualization. More... | |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Friends | |
template<typename tmp > | |
class | MultiLayerNeuralNetwork |
template<typename tmp > | |
class | BackpropagationNeuralNetwork |
template<typename tmp > | |
class | HebbianNeuralNetwork |
class | boost::serialization::access |
std::ostream & | operator<< (std::ostream &os_, Layer &obj_) |
Template base (abstract) class representing a layer.
eT | Template parameter denoting precision of variables (float for calculations/double for testing). |
|
inline |
Default constructor of the layer parent class. Sets the input-output dimensions, layer type and name.
input_height_ | Height of the input sample. |
input_width_ | Width of the input sample. |
input_depth_ | Depth of the input sample. |
output_height_ | Width of the output sample. |
output_width_ | Height of the output sample. |
output_depth_ | Depth of the output sample. |
layer_type_ | Type of the layer. |
name_ | Name of the layer. |
|
inlinevirtual |
|
inlineprotected |
|
pure virtual |
Abstract method responsible for processing the gradients from outputs to inputs (i.e. in the opposite direction). To be overridden in the derived classes.
Implemented in mic::mlnn::convolution::Convolution< eT >, mic::mlnn::convolution::Convolution< double >, mic::mlnn::convolution::Convolution< float >, mic::mlnn::convolution::MaxPooling< eT >, mic::mlnn::fully_connected::Linear< eT >, mic::mlnn::fully_connected::Linear< double >, mic::mlnn::fully_connected::Linear< float >, mic::mlnn::fully_connected::BinaryCorrelator< eT >, mic::mlnn::cost_function::Softmax< eT >, mic::mlnn::cost_function::Softmax< float >, mic::mlnn::fully_connected::HebbianLinear< eT >, mic::mlnn::convolution::Padding< eT >, mic::mlnn::experimental::ConvHebbian< eT >, mic::mlnn::convolution::Cropping< eT >, mic::mlnn::regularisation::Dropout< eT >, mic::mlnn::activation_function::ReLU< eT >, mic::mlnn::activation_function::ELU< eT >, mic::mlnn::activation_function::Sigmoid< eT >, and mic::mlnn::fully_connected::SparseLinear< eT >.
Referenced by mic::mlnn::Layer< float >::backward().
|
inline |
|
inline |
|
inline |
|
pure virtual |
Abstract method responsible for processing the data from the inputs to outputs. To be overridden in the derived classes.
test | Test mode - used for dropout-alike regularization techniques. |
Implemented in mic::mlnn::convolution::Convolution< eT >, mic::mlnn::convolution::Convolution< double >, mic::mlnn::convolution::Convolution< float >, mic::mlnn::fully_connected::BinaryCorrelator< eT >, mic::mlnn::fully_connected::Linear< eT >, mic::mlnn::fully_connected::Linear< double >, mic::mlnn::fully_connected::Linear< float >, mic::mlnn::fully_connected::HebbianLinear< eT >, mic::mlnn::cost_function::Softmax< eT >, mic::mlnn::cost_function::Softmax< float >, mic::mlnn::experimental::ConvHebbian< eT >, mic::mlnn::convolution::MaxPooling< eT >, mic::mlnn::activation_function::ELU< eT >, mic::mlnn::activation_function::ReLU< eT >, mic::mlnn::activation_function::Sigmoid< eT >, mic::mlnn::regularisation::Dropout< eT >, mic::mlnn::convolution::Cropping< eT >, and mic::mlnn::convolution::Padding< eT >.
Referenced by mic::mlnn::Layer< float >::calculateNumericalGradient(), and mic::mlnn::Layer< float >::forward().
|
inline |
|
inline |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Returns activations of output neurons.
Reimplemented in mic::mlnn::experimental::ConvHebbian< eT >.
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
Returns size (length) of inputs.
Definition at line 255 of file Layer.hpp.
Referenced by mic::mlnn::convolution::MaxPooling< eT >::forward(), mic::mlnn::fully_connected::HebbianLinear< eT >::getActivations(), mic::mlnn::fully_connected::BinaryCorrelator< eT >::getActivations(), mic::neural_nets::unit_tests::Linear50x100Double::Linear50x100Double(), mic::neural_nets::unit_tests::Linear50x100Double::SetUp(), mic::mlnn::convolution::Convolution< float >::streamLayerParameters(), and mic::mlnn::Layer< float >::streamLayerParameters().
|
inline |
Allocates memory to a matrix vector (lazy).
vector_ | Vector that will store the matrices. |
vector_size | Number of matrices to be added. |
matrix_height_ | Height of matrices. |
matrix_width_ | Width of matrices. |
Definition at line 543 of file Layer.hpp.
Referenced by mic::mlnn::Layer< float >::getInputActivations(), mic::mlnn::Layer< float >::getInputGradientActivations(), mic::mlnn::fully_connected::Linear< float >::getInverseOutputActivations(), mic::mlnn::convolution::Convolution< float >::getInverseReceptiveFields(), mic::mlnn::fully_connected::Linear< float >::getInverseWeightActivations(), mic::mlnn::experimental::ConvHebbian< eT >::getOutputActivations(), mic::mlnn::Layer< float >::getOutputActivations(), mic::mlnn::Layer< float >::getOutputGradientActivations(), mic::mlnn::experimental::ConvHebbian< eT >::getOutputReconstruction(), mic::mlnn::convolution::Convolution< float >::getReceptiveFields(), mic::mlnn::fully_connected::Linear< float >::getWeightActivations(), mic::mlnn::experimental::ConvHebbian< eT >::getWeightActivations(), mic::mlnn::convolution::Convolution< float >::getWeightActivations(), mic::mlnn::experimental::ConvHebbian< eT >::getWeightDissimilarity(), mic::mlnn::fully_connected::Linear< float >::getWeightGradientActivations(), mic::mlnn::convolution::Convolution< float >::getWeightGradientActivations(), and mic::mlnn::experimental::ConvHebbian< eT >::getWeightSimilarity().
|
inline |
Returns channel from a sample. If a given memory array does not contain such a memory pointer - it (lazy) allocates it. Assumes that: a) a sample is a column vector and b) there is one "channel memory ptr" for each sample (so the whole batch can be processed in parallel). OMP secured - critical section inside.
sample_ptr | Pointer to a sample. |
array_ | Array of matrices where a given matrix (channel) is/will be stored. |
id_ | Channel id (variable prefix). |
sample_number_ | Number of the sample in batch. |
channel_number_ | Number of the channel. |
height_ | Height of the channel. |
width_ | Width of the channel. |
Definition at line 487 of file Layer.hpp.
Referenced by mic::mlnn::Layer< float >::lazyReturnInputChannel(), and mic::mlnn::Layer< float >::lazyReturnOutputChannel().
|
inline |
Returns input channel, with lazy matrix ptr allocation.
batch_ptr_ | Pointer to a batch. |
sample_number_ | Number of the sample in batch. |
channel_number_ | Number of the channel in sample. |
Definition at line 519 of file Layer.hpp.
Referenced by mic::mlnn::convolution::MaxPooling< eT >::forward().
|
inline |
Returns input sample, with lazy matrix ptr allocation.
batch_ptr_ | Pointer to a batch. |
sample_number_ | Number of the sample in batch. |
Definition at line 460 of file Layer.hpp.
Referenced by mic::mlnn::convolution::MaxPooling< eT >::forward().
|
inline |
|
inline |
|
inline |
Returns sample from batch. If a given memory array does not contain such a memory pointer - it (lazy) allocates it. OMP secured - critical section inside.
batch_ptr_ | Pointer to a batch. |
array_ | Array of matrices where a given matrix (sample) is/will be stored. |
id_ | Sample id (variable prefix). |
sample_number_ | Number of the sample in batch. |
sample_size_ | Size of the sample. |
Definition at line 433 of file Layer.hpp.
Referenced by mic::mlnn::Layer< float >::lazyReturnInputSample(), and mic::mlnn::Layer< float >::lazyReturnOutputSample().
|
inline |
|
inline |
Returns size (length) of outputs.
Definition at line 260 of file Layer.hpp.
Referenced by mic::mlnn::fully_connected::SparseLinear< eT >::backward(), mic::mlnn::convolution::MaxPooling< eT >::forward(), mic::mlnn::fully_connected::HebbianLinear< eT >::getActivations(), mic::mlnn::fully_connected::BinaryCorrelator< eT >::getActivations(), mic::neural_nets::unit_tests::Linear50x100Double::Linear50x100Double(), mic::neural_nets::unit_tests::Linear50x100Double::SetUp(), mic::mlnn::fully_connected::SparseLinear< eT >::SparseLinear(), mic::mlnn::convolution::Convolution< float >::streamLayerParameters(), and mic::mlnn::Layer< float >::streamLayerParameters().
|
inlinevirtual |
Reset gradients. Virtual empty method - to be implemented by the inherited classes.
Reimplemented in mic::mlnn::convolution::Convolution< eT >, mic::mlnn::convolution::Convolution< double >, mic::mlnn::convolution::Convolution< float >, mic::mlnn::fully_connected::Linear< eT >, mic::mlnn::fully_connected::Linear< double >, and mic::mlnn::fully_connected::Linear< float >.
|
inlinevirtual |
Changes the size of the batch. By default it resizes state (x,y) and gradients (x,y).
New | size of the batch. |
Reimplemented in mic::mlnn::cost_function::Softmax< eT >, mic::mlnn::cost_function::Softmax< float >, mic::mlnn::convolution::MaxPooling< eT >, and mic::mlnn::regularisation::Dropout< eT >.
Definition at line 199 of file Layer.hpp.
Referenced by mic::mlnn::regularisation::Dropout< eT >::resizeBatch(), mic::mlnn::convolution::MaxPooling< eT >::resizeBatch(), and mic::mlnn::cost_function::Softmax< float >::resizeBatch().
|
inlineprivate |
|
inline |
|
inline |
|
inlinevirtual |
Stream layer parameters.
Reimplemented in mic::mlnn::convolution::Convolution< eT >, mic::mlnn::convolution::Convolution< double >, and mic::mlnn::convolution::Convolution< float >.
|
inline |
Returns the type of layer.
Definition at line 323 of file Layer.hpp.
Referenced by mic::mlnn::convolution::Convolution< float >::streamLayerParameters(), and mic::mlnn::Layer< float >::streamLayerParameters().
|
pure virtual |
Performs the update according to the calculated gradients and injected optimization method. Abstract.
alpha_ | Learning rate - passed to the optimization functions of all layers. |
decay_ | Weight decay rate (determining that the "unused/unupdated" weights will decay to 0) (DEFAULT=0.0 - no decay). |
Implemented in mic::mlnn::convolution::Convolution< eT >, mic::mlnn::convolution::Convolution< double >, mic::mlnn::convolution::Convolution< float >, mic::mlnn::convolution::MaxPooling< eT >, mic::mlnn::fully_connected::Linear< eT >, mic::mlnn::fully_connected::Linear< double >, mic::mlnn::fully_connected::Linear< float >, mic::mlnn::convolution::Cropping< eT >, mic::mlnn::convolution::Padding< eT >, mic::mlnn::cost_function::Softmax< eT >, mic::mlnn::cost_function::Softmax< float >, mic::mlnn::fully_connected::BinaryCorrelator< eT >, mic::mlnn::fully_connected::HebbianLinear< eT >, mic::mlnn::experimental::ConvHebbian< eT >, mic::mlnn::regularisation::Dropout< eT >, mic::mlnn::activation_function::ReLU< eT >, mic::mlnn::activation_function::ELU< eT >, mic::mlnn::activation_function::Sigmoid< eT >, and mic::mlnn::fully_connected::SparseLinear< eT >.
|
friend |
|
friend |
|
friend |
|
protected |
Size (length) of (mini)batch.
Definition at line 744 of file Layer.hpp.
Referenced by mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_db(), mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dW(), mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dx(), mic::mlnn::fully_connected::SparseLinear< eT >::backward(), mic::mlnn::convolution::Cropping< eT >::backward(), mic::mlnn::convolution::Padding< eT >::backward(), mic::mlnn::Layer< float >::batchSize(), mic::mlnn::fully_connected::Linear< float >::calculateMeanReconstructionError(), mic::mlnn::convolution::Convolution< float >::Convolution(), mic::mlnn::convolution::Padding< eT >::forward(), mic::mlnn::convolution::Cropping< eT >::forward(), mic::mlnn::convolution::MaxPooling< eT >::forward(), mic::mlnn::convolution::Convolution< float >::forward(), mic::mlnn::Layer< float >::getInputActivations(), mic::mlnn::Layer< float >::getInputGradientActivations(), mic::mlnn::fully_connected::Linear< float >::getInverseOutputActivations(), mic::mlnn::Layer< float >::getOutputActivations(), mic::mlnn::Layer< float >::getOutputGradientActivations(), mic::mlnn::Layer< float >::Layer(), mic::mlnn::Layer< float >::resizeBatch(), mic::mlnn::Layer< float >::serialize(), mic::mlnn::convolution::Convolution< float >::streamLayerParameters(), and mic::mlnn::Layer< float >::streamLayerParameters().
|
protected |
Vector containing activations of gradients of inputs (dx) - used in visualization.
Definition at line 771 of file Layer.hpp.
Referenced by mic::mlnn::Layer< float >::getInputGradientActivations().
|
protected |
Vector containing activations of gradients of outputs (dy) - used in visualization.
Definition at line 777 of file Layer.hpp.
Referenced by mic::mlnn::Layer< float >::getOutputGradientActivations().
|
protected |
Gradients - contains input [x] and output [y] matrices.
Definition at line 756 of file Layer.hpp.
Referenced by mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_db(), mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dW(), mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dx(), mic::mlnn::fully_connected::SparseLinear< eT >::backward(), mic::mlnn::activation_function::Sigmoid< eT >::backward(), mic::mlnn::activation_function::ELU< eT >::backward(), mic::mlnn::activation_function::ReLU< eT >::backward(), mic::mlnn::regularisation::Dropout< eT >::backward(), mic::mlnn::convolution::Cropping< eT >::backward(), mic::mlnn::convolution::Padding< eT >::backward(), mic::mlnn::cost_function::Softmax< float >::backward(), mic::mlnn::fully_connected::Linear< float >::backward(), mic::mlnn::convolution::MaxPooling< eT >::backward(), mic::mlnn::Layer< float >::backward(), mic::mlnn::convolution::Convolution< float >::backward(), mic::mlnn::convolution::Convolution< float >::Convolution(), mic::mlnn::Layer< float >::getGradient(), mic::mlnn::Layer< float >::getInputGradientActivations(), mic::mlnn::Layer< float >::getOutputGradientActivations(), mic::mlnn::fully_connected::Linear< float >::getWeightGradientActivations(), mic::mlnn::convolution::Convolution< float >::getWeightGradientActivations(), mic::mlnn::Layer< float >::Layer(), mic::mlnn::fully_connected::Linear< float >::resetGrads(), mic::mlnn::convolution::Convolution< float >::resetGrads(), mic::mlnn::Layer< float >::resizeBatch(), mic::mlnn::Layer< float >::serialize(), mic::neural_nets::unit_tests::Linear2x3Float::SetUp(), mic::neural_nets::unit_tests::Linear2x3Double::SetUp(), mic::neural_nets::unit_tests::Linear50x100Double::SetUp(), mic::mlnn::fully_connected::SparseLinear< eT >::update(), mic::mlnn::fully_connected::Linear< float >::update(), and mic::mlnn::convolution::Convolution< float >::update().
|
protected |
Number of channels of the input (e.g. 3 for RGB images).
Definition at line 732 of file Layer.hpp.
Referenced by mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dW(), mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dx(), mic::mlnn::convolution::Cropping< eT >::backward(), mic::mlnn::convolution::Padding< eT >::backward(), mic::mlnn::fully_connected::Linear< float >::calculateMeanReconstructionError(), mic::mlnn::convolution::Convolution< float >::Convolution(), mic::mlnn::convolution::Cropping< eT >::forward(), mic::mlnn::convolution::Padding< eT >::forward(), mic::mlnn::convolution::MaxPooling< eT >::forward(), mic::mlnn::convolution::Convolution< float >::forward(), mic::mlnn::convolution::Convolution< float >::getFilterSimilarityMatrix(), mic::mlnn::Layer< float >::getInputActivations(), mic::mlnn::Layer< float >::getInputGradientActivations(), mic::mlnn::fully_connected::Linear< float >::getInverseOutputActivations(), mic::mlnn::fully_connected::Linear< float >::getInverseWeightActivations(), mic::mlnn::convolution::Convolution< float >::getWeightActivations(), mic::mlnn::convolution::Convolution< float >::getWeightGradientActivations(), mic::mlnn::Layer< float >::inputSize(), mic::mlnn::Layer< float >::Layer(), mic::mlnn::Layer< float >::serialize(), mic::mlnn::convolution::Convolution< float >::streamLayerParameters(), and mic::mlnn::Layer< float >::streamLayerParameters().
|
protected |
Height of the input (e.g. 28 for MNIST).
Definition at line 726 of file Layer.hpp.
Referenced by mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dW(), mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dx(), mic::mlnn::convolution::Cropping< eT >::backward(), mic::mlnn::convolution::Padding< eT >::backward(), mic::mlnn::fully_connected::Linear< float >::calculateMeanReconstructionError(), mic::mlnn::convolution::Convolution< float >::Convolution(), mic::mlnn::convolution::Padding< eT >::forward(), mic::mlnn::convolution::Cropping< eT >::forward(), mic::mlnn::convolution::MaxPooling< eT >::forward(), mic::mlnn::convolution::Convolution< float >::forward(), mic::mlnn::Layer< float >::getInputActivations(), mic::mlnn::Layer< float >::getInputGradientActivations(), mic::mlnn::fully_connected::Linear< float >::getInverseOutputActivations(), mic::mlnn::fully_connected::Linear< float >::getInverseWeightActivations(), mic::mlnn::experimental::ConvHebbian< eT >::getOutputReconstruction(), mic::mlnn::Layer< float >::inputSize(), mic::mlnn::Layer< float >::Layer(), mic::mlnn::Layer< float >::lazyReturnInputChannel(), mic::mlnn::Layer< float >::serialize(), mic::mlnn::convolution::Convolution< float >::streamLayerParameters(), and mic::mlnn::Layer< float >::streamLayerParameters().
|
protected |
Width of the input (e.g. 28 for MNIST).
Definition at line 729 of file Layer.hpp.
Referenced by mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dW(), mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dx(), mic::mlnn::convolution::Cropping< eT >::backward(), mic::mlnn::convolution::Padding< eT >::backward(), mic::mlnn::fully_connected::Linear< float >::calculateMeanReconstructionError(), mic::mlnn::convolution::Convolution< float >::Convolution(), mic::mlnn::convolution::Padding< eT >::forward(), mic::mlnn::convolution::Cropping< eT >::forward(), mic::mlnn::convolution::MaxPooling< eT >::forward(), mic::mlnn::experimental::ConvHebbian< eT >::forward(), mic::mlnn::convolution::Convolution< float >::forward(), mic::mlnn::Layer< float >::getInputActivations(), mic::mlnn::Layer< float >::getInputGradientActivations(), mic::mlnn::fully_connected::Linear< float >::getInverseOutputActivations(), mic::mlnn::fully_connected::Linear< float >::getInverseWeightActivations(), mic::mlnn::experimental::ConvHebbian< eT >::getOutputReconstruction(), mic::mlnn::Layer< float >::inputSize(), mic::mlnn::Layer< float >::Layer(), mic::mlnn::Layer< float >::lazyReturnInputChannel(), mic::mlnn::Layer< float >::serialize(), mic::mlnn::convolution::Convolution< float >::streamLayerParameters(), and mic::mlnn::Layer< float >::streamLayerParameters().
|
protected |
Name (identifier of the type) of the layer.
Definition at line 750 of file Layer.hpp.
Referenced by mic::mlnn::Layer< float >::name(), mic::mlnn::Layer< float >::serialize(), and mic::mlnn::Layer< float >::streamLayerParameters().
|
protected |
Type of the layer.
Definition at line 747 of file Layer.hpp.
Referenced by mic::mlnn::Layer< float >::serialize(), and mic::mlnn::Layer< float >::type().
|
protected |
Memory - a list of temporal parameters, to be used by the derived classes.
Definition at line 762 of file Layer.hpp.
Referenced by mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dW(), mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dx(), mic::mlnn::fully_connected::SparseLinear< eT >::backward(), mic::mlnn::regularisation::Dropout< eT >::backward(), mic::mlnn::convolution::MaxPooling< eT >::backward(), mic::mlnn::fully_connected::BinaryCorrelator< eT >::BinaryCorrelator(), mic::mlnn::fully_connected::Linear< float >::calculateMeanReconstructionError(), mic::mlnn::Layer< float >::calculateNumericalGradient(), mic::mlnn::convolution::Convolution< float >::Convolution(), mic::mlnn::regularisation::Dropout< eT >::Dropout(), mic::mlnn::regularisation::Dropout< eT >::forward(), mic::mlnn::convolution::MaxPooling< eT >::forward(), mic::mlnn::cost_function::Softmax< float >::forward(), mic::mlnn::fully_connected::BinaryCorrelator< eT >::forward(), mic::mlnn::convolution::Convolution< float >::forward(), mic::mlnn::convolution::Convolution< float >::getFilterSimilarityMatrix(), mic::mlnn::Layer< float >::getInputActivations(), mic::mlnn::Layer< float >::getInputGradientActivations(), mic::mlnn::fully_connected::Linear< float >::getInverseOutputActivations(), mic::mlnn::convolution::Convolution< float >::getInverseReceptiveFields(), mic::mlnn::Layer< float >::getOutputActivations(), mic::mlnn::Layer< float >::getOutputGradientActivations(), mic::mlnn::convolution::Convolution< float >::getReceptiveFields(), mic::mlnn::Layer< float >::Layer(), mic::mlnn::Layer< float >::lazyAllocateMatrixVector(), mic::mlnn::Layer< float >::lazyReturnChannelFromSample(), mic::mlnn::Layer< float >::lazyReturnInputChannel(), mic::mlnn::Layer< float >::lazyReturnInputSample(), mic::mlnn::Layer< float >::lazyReturnOutputChannel(), mic::mlnn::Layer< float >::lazyReturnOutputSample(), mic::mlnn::Layer< float >::lazyReturnSampleFromBatch(), mic::mlnn::convolution::MaxPooling< eT >::MaxPooling(), mic::mlnn::regularisation::Dropout< eT >::resizeBatch(), mic::mlnn::convolution::MaxPooling< eT >::resizeBatch(), mic::mlnn::cost_function::Softmax< float >::resizeBatch(), mic::mlnn::Layer< float >::serialize(), mic::mlnn::cost_function::Softmax< float >::Softmax(), mic::mlnn::fully_connected::SparseLinear< eT >::SparseLinear(), mic::mlnn::fully_connected::SparseLinear< eT >::update(), and mic::mlnn::fully_connected::BinaryCorrelator< eT >::update().
|
protected |
Array of optimization functions.
Definition at line 765 of file Layer.hpp.
Referenced by mic::mlnn::Layer< float >::setOptimization(), mic::mlnn::fully_connected::SparseLinear< eT >::update(), mic::mlnn::experimental::ConvHebbian< eT >::update(), mic::mlnn::fully_connected::HebbianLinear< eT >::update(), mic::mlnn::fully_connected::BinaryCorrelator< eT >::update(), mic::mlnn::fully_connected::Linear< float >::update(), and mic::mlnn::convolution::Convolution< float >::update().
|
protected |
Number of filters = number of output channels.
Definition at line 741 of file Layer.hpp.
Referenced by mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_db(), mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dW(), mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dx(), mic::mlnn::convolution::Convolution< float >::Convolution(), mic::mlnn::convolution::Convolution< float >::forward(), mic::mlnn::convolution::Convolution< float >::getFilterSimilarityMatrix(), mic::mlnn::fully_connected::Linear< float >::getInverseWeightActivations(), mic::mlnn::Layer< float >::getOutputActivations(), mic::mlnn::Layer< float >::getOutputGradientActivations(), mic::mlnn::convolution::Convolution< float >::getWeightActivations(), mic::mlnn::convolution::Convolution< float >::getWeightGradientActivations(), mic::mlnn::Layer< float >::Layer(), mic::mlnn::Layer< float >::outputSize(), mic::mlnn::Layer< float >::serialize(), mic::mlnn::convolution::Convolution< float >::streamLayerParameters(), and mic::mlnn::Layer< float >::streamLayerParameters().
|
protected |
Number of receptive fields in a single channel - vertical direction.
Definition at line 735 of file Layer.hpp.
Referenced by mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_db(), mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dW(), mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dx(), mic::mlnn::convolution::Cropping< eT >::backward(), mic::mlnn::convolution::Convolution< float >::Convolution(), mic::mlnn::convolution::Cropping< eT >::forward(), mic::mlnn::convolution::MaxPooling< eT >::forward(), mic::mlnn::experimental::ConvHebbian< eT >::forward(), mic::mlnn::convolution::Convolution< float >::forward(), mic::mlnn::convolution::Convolution< float >::getInverseReceptiveFields(), mic::mlnn::fully_connected::Linear< float >::getInverseWeightActivations(), mic::mlnn::experimental::ConvHebbian< eT >::getOutputActivations(), mic::mlnn::Layer< float >::getOutputActivations(), mic::mlnn::Layer< float >::getOutputGradientActivations(), mic::mlnn::experimental::ConvHebbian< eT >::getOutputReconstruction(), mic::mlnn::convolution::Convolution< float >::getReceptiveFields(), mic::mlnn::Layer< float >::Layer(), mic::mlnn::Layer< float >::lazyReturnOutputChannel(), mic::mlnn::Layer< float >::outputSize(), mic::mlnn::Layer< float >::serialize(), mic::mlnn::convolution::Convolution< float >::streamLayerParameters(), mic::mlnn::Layer< float >::streamLayerParameters(), and mic::neural_nets::unit_tests::TEST().
|
protected |
Number of receptive fields in a single channel - horizontal direction.
Definition at line 738 of file Layer.hpp.
Referenced by mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_db(), mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dW(), mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dx(), mic::mlnn::convolution::Cropping< eT >::backward(), mic::mlnn::convolution::Convolution< float >::Convolution(), mic::mlnn::convolution::Cropping< eT >::forward(), mic::mlnn::convolution::MaxPooling< eT >::forward(), mic::mlnn::experimental::ConvHebbian< eT >::forward(), mic::mlnn::convolution::Convolution< float >::forward(), mic::mlnn::convolution::Convolution< float >::getInverseReceptiveFields(), mic::mlnn::fully_connected::Linear< float >::getInverseWeightActivations(), mic::mlnn::experimental::ConvHebbian< eT >::getOutputActivations(), mic::mlnn::Layer< float >::getOutputActivations(), mic::mlnn::Layer< float >::getOutputGradientActivations(), mic::mlnn::experimental::ConvHebbian< eT >::getOutputReconstruction(), mic::mlnn::convolution::Convolution< float >::getReceptiveFields(), mic::mlnn::Layer< float >::Layer(), mic::mlnn::Layer< float >::lazyReturnOutputChannel(), mic::mlnn::Layer< float >::outputSize(), mic::mlnn::Layer< float >::serialize(), mic::mlnn::convolution::Convolution< float >::streamLayerParameters(), mic::mlnn::Layer< float >::streamLayerParameters(), and mic::neural_nets::unit_tests::TEST().
|
protected |
Parameters - parameters of the layer, to be used by the derived classes.
Definition at line 759 of file Layer.hpp.
Referenced by mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dx(), mic::mlnn::fully_connected::SparseLinear< eT >::backward(), mic::mlnn::fully_connected::Linear< float >::backward(), mic::mlnn::fully_connected::BinaryCorrelator< eT >::BinaryCorrelator(), mic::mlnn::Layer< float >::calculateNumericalGradient(), mic::mlnn::experimental::ConvHebbian< eT >::ConvHebbian(), mic::mlnn::convolution::Convolution< float >::Convolution(), mic::mlnn::experimental::ConvHebbian< eT >::forward(), mic::mlnn::fully_connected::HebbianLinear< eT >::forward(), mic::mlnn::fully_connected::Linear< float >::forward(), mic::mlnn::convolution::Convolution< float >::forward(), mic::mlnn::fully_connected::HebbianLinear< eT >::getActivations(), mic::mlnn::fully_connected::BinaryCorrelator< eT >::getActivations(), mic::mlnn::convolution::Convolution< float >::getFilterSimilarityMatrix(), mic::mlnn::fully_connected::Linear< float >::getInverseOutputActivations(), mic::mlnn::fully_connected::Linear< float >::getInverseWeightActivations(), mic::mlnn::experimental::ConvHebbian< eT >::getOutputReconstruction(), mic::mlnn::Layer< float >::getParam(), mic::mlnn::fully_connected::Linear< float >::getWeightActivations(), mic::mlnn::experimental::ConvHebbian< eT >::getWeightActivations(), mic::mlnn::convolution::Convolution< float >::getWeightActivations(), mic::mlnn::experimental::ConvHebbian< eT >::getWeightDissimilarity(), mic::mlnn::experimental::ConvHebbian< eT >::getWeightSimilarity(), mic::mlnn::fully_connected::HebbianLinear< eT >::HebbianLinear(), mic::mlnn::fully_connected::Linear< float >::Linear(), mic::mlnn::Layer< float >::serialize(), mic::mlnn::Layer< float >::setOptimization(), mic::neural_nets::unit_tests::Linear1x1Float::SetUp(), mic::neural_nets::unit_tests::Conv2x2x2Filter2x1x1s1Double::SetUp(), mic::neural_nets::unit_tests::Linear2x3Float::SetUp(), mic::neural_nets::unit_tests::Conv3x3x2Filter3x2x2s1Float::SetUp(), mic::neural_nets::unit_tests::Linear2x3Double::SetUp(), mic::neural_nets::unit_tests::Linear50x100Double::SetUp(), mic::neural_nets::unit_tests::Conv4x4x1Filter1x2x2s2Float::SetUp(), mic::neural_nets::unit_tests::Conv4x4x1Filter3x1x1s3Double::SetUp(), mic::neural_nets::unit_tests::Conv5x5x1Filter1x3x3s1Float::SetUp(), mic::neural_nets::unit_tests::Conv5x5x1Filter1x2x2s3Float::SetUp(), mic::neural_nets::unit_tests::Conv7x7x3Filter3x3x3s2Float::SetUp(), mic::neural_nets::unit_tests::Conv5x6x1Filter1x4x4s1Float::SetUp(), mic::neural_nets::unit_tests::TEST(), mic::mlnn::fully_connected::SparseLinear< eT >::update(), mic::mlnn::experimental::ConvHebbian< eT >::update(), mic::mlnn::fully_connected::HebbianLinear< eT >::update(), mic::mlnn::fully_connected::BinaryCorrelator< eT >::update(), mic::mlnn::fully_connected::Linear< float >::update(), and mic::mlnn::convolution::Convolution< float >::update().
|
protected |
States - contains input [x] and output [y] matrices.
Definition at line 753 of file Layer.hpp.
Referenced by mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dW(), mic::mlnn::convolution::Convolution< float >::backpropagade_dy_to_dx(), mic::mlnn::fully_connected::SparseLinear< eT >::backward(), mic::mlnn::activation_function::Sigmoid< eT >::backward(), mic::mlnn::activation_function::ELU< eT >::backward(), mic::mlnn::activation_function::ReLU< eT >::backward(), mic::mlnn::cost_function::Softmax< float >::backward(), mic::mlnn::fully_connected::Linear< float >::backward(), mic::mlnn::fully_connected::Linear< float >::calculateMeanReconstructionError(), mic::mlnn::convolution::Convolution< float >::Convolution(), mic::mlnn::convolution::Cropping< eT >::forward(), mic::mlnn::convolution::Padding< eT >::forward(), mic::mlnn::regularisation::Dropout< eT >::forward(), mic::mlnn::activation_function::Sigmoid< eT >::forward(), mic::mlnn::activation_function::ReLU< eT >::forward(), mic::mlnn::activation_function::ELU< eT >::forward(), mic::mlnn::convolution::MaxPooling< eT >::forward(), mic::mlnn::experimental::ConvHebbian< eT >::forward(), mic::mlnn::cost_function::Softmax< float >::forward(), mic::mlnn::fully_connected::HebbianLinear< eT >::forward(), mic::mlnn::fully_connected::Linear< float >::forward(), mic::mlnn::fully_connected::BinaryCorrelator< eT >::forward(), mic::mlnn::Layer< float >::forward(), mic::mlnn::convolution::Convolution< float >::forward(), mic::mlnn::Layer< float >::getInputActivations(), mic::mlnn::fully_connected::Linear< float >::getInverseOutputActivations(), mic::mlnn::experimental::ConvHebbian< eT >::getOutputActivations(), mic::mlnn::Layer< float >::getOutputActivations(), mic::mlnn::experimental::ConvHebbian< eT >::getOutputReconstruction(), mic::mlnn::experimental::ConvHebbian< eT >::getOutputReconstructionError(), mic::mlnn::Layer< float >::getState(), mic::mlnn::Layer< float >::Layer(), mic::mlnn::Layer< float >::resizeBatch(), mic::mlnn::Layer< float >::serialize(), mic::mlnn::Layer< float >::setState(), mic::neural_nets::unit_tests::Linear2x3Float::SetUp(), mic::neural_nets::unit_tests::Linear2x3Double::SetUp(), mic::neural_nets::unit_tests::Linear50x100Double::SetUp(), mic::neural_nets::unit_tests::TEST(), mic::mlnn::experimental::ConvHebbian< eT >::update(), mic::mlnn::fully_connected::HebbianLinear< eT >::update(), and mic::mlnn::fully_connected::BinaryCorrelator< eT >::update().
|
protected |
Vector containing activations of input neurons - used in visualization.
Definition at line 768 of file Layer.hpp.
Referenced by mic::mlnn::Layer< float >::getInputActivations().
|
protected |
Vector containing activations of output neurons - used in visualization.
Definition at line 774 of file Layer.hpp.
Referenced by mic::mlnn::Layer< float >::getOutputActivations().