44 std::snprintf(s,100,
"(%g)",p);
45 id =
type+std::string(s);
86 arma::Col<DNN_Dtype> p_mat(N_,arma::fill::randu);
88 drop_mask.elem(arma::find(p_mat < p)).fill(1/p);
113 std::cout <<
"Dropout rate: " << p << std::endl;
void upd_buf_size(arma::uword nmb)
Updates the buffer sizes.
std::string type
Layer type string.
layer_drop(DNN_Dtype prob)
Dropout layer constructor.
arma::Mat< DNN_Dtype > Y
Output buffer mini batch [N_right,N_batch].
DNN_Dtype p
Probability for a neuron to be present.
void disp(void)
Display info about layer.
arma::uword N_rows_left
Input rows.
layer * right
Pointer to next layer.
arma::uword N_channels_right
Output channels, number of filters.
arma::Mat< DNN_Dtype > Dleft
Error buffer [N_left,N_batch].
arma::uword N_cols_left
Input cols.
PHASE phase
Active state/phase.
virtual void init(void)
Initialize layer.
virtual void init(void)
Initialization of layer.
virtual arma::Mat< DNN_Dtype > * get_Dleft_ptr(void)
Get error buffer pointer - mini batch.
virtual void disp(void)
Display info about layer.
float DNN_Dtype
Data type used in the network (float or double)
arma::uword N_left
Total size left.
arma::uword N_rows_right
Output rows.
virtual void upd_buf_size(arma::uword nmb)
Update layer buffer sizes.
void backprop(void)
Backpropagation of mini batch propagation though layer.
arma::uword N_batch
Mini batch size.
bool train_par
Enable training.
arma::uword N_channels_left
Input channels, number of filters.
arma::uword N_right
Total size right.
arma::Mat< DNN_Dtype > drop_mask
Internal matrix for drop mask.
layer * left
Pointer to previous layer.
arma::uword N_cols_right
Output cols.
virtual arma::Mat< DNN_Dtype > * get_Y_ptr(void)
Get output buffer pointer - mini batch.
void prop_mb(void)
Forward mini batch propagation though layer.