|
| Dropout (float rate, unsigned int seed=0) |
| The Dropout layer randomly sets input units to 0 with a frequency of rate at each step during training time, which helps prevent overfitting. Inputs not set to 0 are scaled up by 1 / (1 - rate) such that the sum over all inputs is unchanged.
|
|
std::string | getSlug () const override |
| Dropout layer slug.
|
|
Eigen::MatrixXd | feedInputs (Eigen::MatrixXd inputs, bool training=false) override |
| This method is used to feed the inputs to the layer.
|
|
Eigen::MatrixXd | getOutputs () const |
| This method get the layer's outputs.
|
|
int | getNumNeurons () const |
| This method get the number of neurons actually in the layer.
|
|
void | printOutputs () |
| Method to print layer's outputs.
|
|
virtual Eigen::MatrixXd | feedInputs (std::vector< double > inputs, bool training=false) |
| This method is used to feed the inputs to the layer.
|
|
virtual void | feedInputs (std::vector< std::vector< std::vector< double > > > inputs, bool training=false) |
| This method is used to feed the inputs to the layer.
|
|
const std::string | typeStr () |
|
|
float | rate |
|
float | scaleRate |
|
unsigned int | seed |
|
Eigen::MatrixXd | mask |
|
|
void | init (int numNeurons) override |
|
Eigen::MatrixXd | computeOutputs (Eigen::MatrixXd inputs, bool training) override |
| Drop some of the inputs randomly at the given rate.
|
|
void | setOutputs (Eigen::MatrixXd outputs) |
|
void | setOutputs (std::vector< double > outputs) |
| This method is used to set the outputs of the layer.
|
|
| Layer (std::tuple< int, int > inputShape) |
|
|
int | nNeurons |
|
Eigen::MatrixXd | outputs |
|
LayerType | type = LayerType::DEFAULT |
|
bool | trainingOnly = false |
|
◆ Dropout()
NeuralNet::Dropout::Dropout |
( |
float | rate, |
|
|
unsigned int | seed = 0 ) |
|
inline |
The Dropout layer randomly sets input units to 0 with a frequency of rate at each step during training time, which helps prevent overfitting. Inputs not set to 0 are scaled up by 1 / (1 - rate) such that the sum over all inputs is unchanged.
- Parameters
-
rate | Frequency of units set to 0 |
seed | An integer to use as a random seed |
◆ computeOutputs()
Eigen::MatrixXd NeuralNet::Dropout::computeOutputs |
( |
Eigen::MatrixXd | inputs, |
|
|
bool | training ) |
|
inlineoverrideprotectedvirtual |
Drop some of the inputs randomly at the given rate.
- Parameters
-
inputs | A matrix representing the inputs (features) |
- Returns
- Inputs with some dropped values (zero-ed values) randomly
Implements NeuralNet::Layer.
◆ feedInputs()
Eigen::MatrixXd NeuralNet::Dropout::feedInputs |
( |
Eigen::MatrixXd | inputs, |
|
|
bool | training = false ) |
|
inlineoverridevirtual |
This method is used to feed the inputs to the layer.
- Parameters
-
inputs | An Eigen::MatrixXd representing the inputs (features) |
- Returns
- an Eigen::MatrixXd representing the outputs of the layer
Implements NeuralNet::Layer.
◆ getSlug()
std::string NeuralNet::Dropout::getSlug |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ init()
void NeuralNet::Dropout::init |
( |
int | numNeurons | ) |
|
|
inlineoverrideprotectedvirtual |
- Parameters
-
numNeurons | Number of neurons of the previous layers |
Reimplemented from NeuralNet::Layer.
The documentation for this class was generated from the following file: