NeuralNet 1.0
Loading...
Searching...
No Matches
NeuralNet::Flatten Class Reference
Inheritance diagram for NeuralNet::Flatten:
NeuralNet::Layer

Public Member Functions

 Flatten (std::tuple< int, int > inputShape)
 Construct a new Flatten object.
 
std::string getSlug () const override
 Flatten layer's slug.
 
Eigen::MatrixXd flatten (std::vector< std::vector< std::vector< double > > > inputs)
 This method flattens a 3D vector into a 2D Eigen::MatrixXd.
 
void feedInputs (std::vector< std::vector< std::vector< double > > > inputs, bool training) override
 This method is used to feed the inputs to the layer.
 
Eigen::MatrixXd feedInputs (Eigen::MatrixXd inputs, bool training) override
 This method is used to feed the inputs to the layer.
 
- Public Member Functions inherited from NeuralNet::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.
 
const std::string typeStr ()
 

Friends

class cereal::access
 

Additional Inherited Members

- Protected Member Functions inherited from NeuralNet::Layer
void setOutputs (Eigen::MatrixXd outputs)
 
void setOutputs (std::vector< double > outputs)
 This method is used to set the outputs of the layer.
 
virtual void init (int args)
 
 Layer (std::tuple< int, int > inputShape)
 
- Protected Attributes inherited from NeuralNet::Layer
int nNeurons
 
Eigen::MatrixXd outputs
 
LayerType type = LayerType::DEFAULT
 
bool trainingOnly = false
 

Constructor & Destructor Documentation

◆ Flatten()

NeuralNet::Flatten::Flatten ( std::tuple< int, int > inputShape)
inline

Construct a new Flatten object.

This type of Layer is perfect as an input layer since its sole purpose is to flatten a given input

Parameters
inputShapeThe shape of the input to be flattened

Member Function Documentation

◆ feedInputs() [1/2]

Eigen::MatrixXd NeuralNet::Flatten::feedInputs ( Eigen::MatrixXd inputs,
bool training )
inlineoverridevirtual

This method is used to feed the inputs to the layer.

Parameters
inputsAn Eigen::MatrixXd representing the inputs (features)
Returns
an Eigen::MatrixXd representing the outputs of the layer

Implements NeuralNet::Layer.

◆ feedInputs() [2/2]

void NeuralNet::Flatten::feedInputs ( std::vector< std::vector< std::vector< double > > > inputs,
bool training )
inlineoverridevirtual

This method is used to feed the inputs to the layer.

Parameters
inputsA vector of vectors of doubles representing the inputs (features)
Returns
void

Reimplemented from NeuralNet::Layer.

◆ flatten()

Eigen::MatrixXd NeuralNet::Flatten::flatten ( std::vector< std::vector< std::vector< double > > > inputs)
inline

This method flattens a 3D vector into a 2D Eigen::MatrixXd.

Parameters
inputsThe 3D vector to be flattened
Returns
Eigen::MatrixXd The flattened 2D Eigen::MatrixXd

◆ getSlug()

std::string NeuralNet::Flatten::getSlug ( ) const
inlineoverridevirtual

Flatten layer's slug.

Implements NeuralNet::Layer.


The documentation for this class was generated from the following file: