Deep network
|
#include <layer.hpp>
Public Member Functions | |
Layer (size_t n, size_t m) | |
~Layer () | |
size_t | get_input_size () const |
size_t | get_output_size () const |
Vector | get_output () const |
virtual Vector | feed_forward (Vector x)=0 |
virtual void | init_nabla ()=0 |
virtual Vector | back_propagation (Vector e)=0 |
virtual void | update (Real eta)=0 |
Public Attributes | |
string | name |
size_t | n |
size_t | m |
Vector | x |
Vector | y |
Vector | d |
An abstract class representing a layer of a deep network. Such a layer can be seen as a map
\[ \begin{array}{rcl} f:\mathbb{R}^n&\mapsto&\mathbb{R}^m\\ x&\to&y \end{array} \]
.
|
inline |
|
inline |
Apply back propagation algorithm on the delta output vector d. Used the input vector stored in x_in_ref during feedforward. Return a reference to the computed (and stored) input delta vector. Nabla vectors must be computed here.
Implemented in Layer::ActivationLayer< A >, Layer::ConvolutionLayer, Layer::FullConnectedLayer, and Layer::Pooling.
Apply the layer to the input vector x
. Vectors x_in_ref
and x_out
must be updated in consequence. Return a reference to x_out.
Implemented in Layer::ActivationLayer< A >, Layer::ConvolutionLayer, Layer::FullConnectedLayer, and Layer::Pooling.
|
inline |
Return the input size.
|
inline |
Return a reference to the computed output vector.
|
inline |
Return the output size.
|
pure virtual |
Initialize nabla vectors which are used during gradient descent.
Implemented in Layer::ActivationLayer< A >, Layer::ConvolutionLayer, Layer::FullConnectedLayer, and Layer::Pooling.
|
pure virtual |
Update layer parameters using gradient descent algorithm with learning rate eta.
Implemented in Layer::ActivationLayer< A >, Layer::ConvolutionLayer, Layer::FullConnectedLayer, and Layer::Pooling.
Vector Layer::Layer::d |
Computed input delta vector computed by back propagation algorithm. Owned by the layer.
size_t Layer::Layer::m |
Size of the output vector.
size_t Layer::Layer::n |
Size of the input vector.
string Layer::Layer::name |
The name of the layer. Used for debugging.
Vector Layer::Layer::x |
A reference to the input vector.
Vector Layer::Layer::y |
Computed output vector. Owned by the layer.