gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
NeuralLayer< TYPE > Class Template Reference

#include <NeuralNetwork.H>

Inheritance diagram for NeuralLayer< TYPE >:
[legend]

Public Member Functions

 NeuralLayer (int inputSize, int outputSize)
 
template<typename Derived >
 NeuralLayer (const Eigen::MatrixBase< Derived > &weightsIn, const Eigen::MatrixBase< Derived > &biasIn)
 
virtual ~NeuralLayer (void)
 Destructor. More...
 
virtual Eigen::Matrix< TYPE, Eigen::Dynamic, 1 > & activate (const Eigen::Matrix< TYPE, Eigen::Dynamic, 1 > &input)
 
int inputSize (void)
 
int outputSize (void)
 

Public Attributes

Eigen::Matrix< TYPE, Eigen::Dynamic, 1 > output
 The output from this layer. More...
 

Protected Attributes

Eigen::Matrix< TYPE, Eigen::Dynamic, Eigen::Dynamic > weights
 The neural weights for this layer. More...
 
Eigen::Matrix< TYPE, Eigen::Dynamic, 1 > bias
 The biases for this layer. More...
 

Detailed Description

template<typename TYPE>
class NeuralLayer< TYPE >

Implements a single neural layer

Template Parameters
TYPEthe precision of the data to use, e.g. float, double
Examples:
NeuralNetworkFnTest.C, and NeuralNetworkTest.C.

Definition at line 28 of file NeuralNetwork.H.

Constructor & Destructor Documentation

◆ NeuralLayer() [1/2]

template<typename TYPE >
NeuralLayer< TYPE >::NeuralLayer ( int  inputSize,
int  outputSize 
)
inline

Generate a neural layer of particular size

Parameters
inputSizeThe number of the inputs
outputSizeThe number of outputs

Definition at line 40 of file NeuralNetwork.H.

◆ NeuralLayer() [2/2]

template<typename TYPE >
template<typename Derived >
NeuralLayer< TYPE >::NeuralLayer ( const Eigen::MatrixBase< Derived > &  weightsIn,
const Eigen::MatrixBase< Derived > &  biasIn 
)
inline

Generate a neural layer of particular size providing the weights

Parameters
weightsInThe weights to set
biasInThe biases to set
Template Parameters
Derivedis used by Eigen's Curiously recurring template pattern (CRTP)

Definition at line 52 of file NeuralNetwork.H.

◆ ~NeuralLayer()

template<typename TYPE >
virtual NeuralLayer< TYPE >::~NeuralLayer ( void  )
inlinevirtual

Destructor.

Definition at line 59 of file NeuralNetwork.H.

Member Function Documentation

◆ activate()

template<typename TYPE >
virtual Eigen::Matrix<TYPE, Eigen::Dynamic, 1>& NeuralLayer< TYPE >::activate ( const Eigen::Matrix< TYPE, Eigen::Dynamic, 1 > &  input)
inlinevirtual

The activation function This evaluates the neural network

Parameters
inputThe input to this layer
Returns
The result of the layer after processing the input

Reimplemented in TanhLayer< TYPE >, and SigmoidLayer< TYPE >.

Definition at line 66 of file NeuralNetwork.H.

Here is the caller graph for this function:

◆ inputSize()

template<typename TYPE >
int NeuralLayer< TYPE >::inputSize ( void  )
inline
Returns
the number of inputs to this layer.

Definition at line 79 of file NeuralNetwork.H.

◆ outputSize()

template<typename TYPE >
int NeuralLayer< TYPE >::outputSize ( void  )
inline
Returns
the number of outputs from this layer.

Definition at line 84 of file NeuralNetwork.H.

Member Data Documentation

◆ bias

template<typename TYPE >
Eigen::Matrix<TYPE, Eigen::Dynamic, 1> NeuralLayer< TYPE >::bias
protected

The biases for this layer.

Definition at line 31 of file NeuralNetwork.H.

◆ output

template<typename TYPE >
Eigen::Matrix<TYPE, Eigen::Dynamic, 1> NeuralLayer< TYPE >::output

The output from this layer.

Definition at line 34 of file NeuralNetwork.H.

◆ weights

template<typename TYPE >
Eigen::Matrix<TYPE, Eigen::Dynamic, Eigen::Dynamic> NeuralLayer< TYPE >::weights
protected

The neural weights for this layer.

Definition at line 30 of file NeuralNetwork.H.


The documentation for this class was generated from the following file:
gtkIOStream: NeuralLayer< TYPE > Class Template Reference
GTK+ IOStream  Beta