Layer class width shared weight and bias layers.
Like the Layer class only that weight matrices are shared between different instances of the net, which can be used to implement multithreading 'Hogwild' style.
Public Types | |
using | Matrix_t = typename Architecture_t::Matrix_t |
using | Scalar_t = typename Architecture_t::Scalar_t |
using | Tensor_t = typename Architecture_t::Tensor_t |
Public Member Functions | |
TSharedLayer (const TSharedLayer &layer) | |
TSharedLayer (size_t fBatchSize, TLayer< Architecture_t > &layer) | |
void | Backward (Matrix_t &gradients_backward, const Matrix_t &activations_backward, ERegularization r, Scalar_t weightDecay) |
Compute weight, bias and activation gradients. | |
void | Forward (Matrix_t &input, bool applyDropout=false) |
Compute activation of the layer for the given input. | |
EActivationFunction | GetActivationFunction () const |
Matrix_t & | GetActivationGradients () |
const Matrix_t & | GetActivationGradients () const |
size_t | GetBatchSize () const |
Matrix_t & | GetBiases () |
const Matrix_t & | GetBiases () const |
Matrix_t & | GetBiasGradients () |
const Matrix_t & | GetBiasGradients () const |
size_t | GetDropoutProbability () const |
size_t | GetInputWidth () const |
Matrix_t & | GetOutput () |
const Matrix_t & | GetOutput () const |
Matrix_t & | GetWeightGradients () |
const Matrix_t & | GetWeightGradients () const |
Matrix_t & | GetWeights () const |
size_t | GetWidth () const |
void | Print () const |
void | SetDropoutProbability (Scalar_t p) |
Private Attributes | |
Matrix_t | fActivationGradients |
Gradients w.r.t. the activations of this layer. | |
size_t | fBatchSize |
Batch size used for training and evaluation. | |
Matrix_t & | fBiases |
Reference to the bias vectors of this layer. | |
Matrix_t | fBiasGradients |
Gradients w.r.t. the bias values of this layer. | |
Matrix_t | fDerivatives |
First fDerivatives of the activations of this layer. | |
Scalar_t | fDropoutProbability |
Probability that an input is active. | |
EActivationFunction | fF |
Activation function of the layer. | |
size_t | fInputWidth |
Number of neurons of the previous layer. | |
Matrix_t | fOutput |
Activations of this layer. | |
Matrix_t | fWeightGradients |
Gradients w.r.t. the weights of this layer. | |
Matrix_t & | fWeights |
Reference to the weight matrix of this layer. | |
size_t | fWidth |
Number of neurons of this layer. | |
#include <TMVA/DNN/Layer.h>
using TMVA::DNN::TSharedLayer< Architecture_t >::Matrix_t = typename Architecture_t::Matrix_t |
using TMVA::DNN::TSharedLayer< Architecture_t >::Scalar_t = typename Architecture_t::Scalar_t |
using TMVA::DNN::TSharedLayer< Architecture_t >::Tensor_t = typename Architecture_t::Tensor_t |
TMVA::DNN::TSharedLayer< Architecture_t >::TSharedLayer | ( | size_t | fBatchSize, |
TLayer< Architecture_t > & | layer | ||
) |
TMVA::DNN::TSharedLayer< Architecture_t >::TSharedLayer | ( | const TSharedLayer< Architecture_t > & | layer | ) |
|
inline |
|
inline |
Compute activation of the layer for the given input.
The input must be in matrix form with the different rows corresponding to different events in the batch. Computes activations as well as the first partial derivative of the activation function at those activations.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void TMVA::DNN::TSharedLayer< Architecture_t >::Print |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |