RBFType< MatType, Activation > Class Template Reference

Implementation of the Radial Basis Function layer. More...

Inheritance diagram for RBFType< MatType, Activation >:

Public Member Functions

 RBFType ()
 Create the RBFType object. More...

 
 RBFType (const size_t outSize, MatType &centres, double betas=0)
 Create the Radial Basis Function layer object using the specified parameters. More...

 
 RBFType (const RBFType &other)
 Copy the given RBFType layer. More...

 
 RBFType (RBFType &&other)
 Take ownership of the given RBFType layer. More...

 
virtual ~RBFType ()
 
void Backward (const MatType &, const MatType &, MatType &)
 Ordinary feed backward pass of the radial basis function. More...

 
RBFTypeClone () const
 Clone the LinearType object. This handles polymorphism correctly. More...

 
void ComputeOutputDimensions ()
 Compute the output dimensions of the layer given InputDimensions(). More...

 
void Forward (const MatType &input, MatType &output)
 Ordinary feed forward pass of the radial basis function. More...

 
RBFTypeoperator= (const RBFType &other)
 Copy the given RBFType layer. More...

 
RBFTypeoperator= (RBFType &&other)
 Take ownership of the given RBFType layer. More...

 
template
<
typename
Archive
>
void serialize (Archive &ar, const uint32_t)
 Serialize the layer. More...

 
size_t WeightSize () const
 Get the size of the weights. More...

 
- Public Member Functions inherited from Layer< MatType >
 Layer ()
 Default constructor. More...

 
 Layer (const Layer &layer)
 Copy constructor. This is not responsible for copying weights! More...

 
 Layer (Layer &&layer)
 Move constructor. This is not responsible for moving weights! More...

 
virtual ~Layer ()
 Default deconstructor. More...

 
virtual void Forward (const MatType &, const MatType &)
 Takes an input and output object, and computes the corresponding loss of the layer. More...

 
virtual void Gradient (const MatType &, const MatType &, MatType &)
 Computing the gradient of the layer with respect to its own input. More...

 
const std::vector< size_t > & InputDimensions () const
 Get the input dimensions. More...

 
std::vector< size_t > & InputDimensions ()
 Modify the input dimensions. More...

 
virtual double Loss ()
 Get the layer loss. More...

 
virtual Layeroperator= (const Layer &layer)
 Copy assignment operator. This is not responsible for copying weights! More...

 
virtual Layeroperator= (Layer &&layer)
 Move assignment operator. This is not responsible for moving weights! More...

 
const std::vector< size_t > & OutputDimensions ()
 Get the output dimensions. More...

 
virtual size_t OutputSize () final
 Get the number of elements in the output from this layer. More...

 
virtual const MatType & Parameters () const
 Get the parameters. More...

 
virtual MatType & Parameters ()
 Set the parameters. More...

 
template
<
typename
Archive
>
void serialize (Archive &ar, const uint32_t)
 Serialize the layer. More...

 
virtual void SetWeights (typename MatType::elem_type *)
 Reset the layer parameter. More...

 
virtual bool const & Training () const
 Get whether the layer is currently in training mode. More...

 
virtual bool & Training ()
 Modify whether the layer is currently in training mode. More...

 

Additional Inherited Members

- Protected Attributes inherited from Layer< MatType >
std::vector< size_t > inputDimensions
 Logical input dimensions of each point. More...

 
std::vector< size_t > outputDimensions
 Logical output dimensions of each point. More...

 
bool training
 If true, the layer is in training mode; otherwise, it is in testing mode. More...

 
bool validOutputDimensions
 This is true if ComputeOutputDimensions() has been called, and outputDimensions can be considered to be up-to-date. More...

 

Detailed Description


template
<
typename
MatType
=
arma::mat
,
typename
Activation
=
GaussianFunction
>

class mlpack::ann::RBFType< MatType, Activation >

Implementation of the Radial Basis Function layer.

The RBFType class, when used with a non-linear activation function, acts as a Radial Basis Function which can be used with a feed-forward neural network.

For more information, refer to the following paper,

@article{Volume 51: Artificial Intelligence and Statistics,
author = {Qichao Que, Mikhail Belkin},
title = {Back to the Future: Radial Basis Function Networks Revisited},
year = {2016},
url = {http://proceedings.mlr.press/v51/que16.pdf},
}
Template Parameters
MatTypeMatrix representation to accept as input and use for computation.
ActivationType of the activation function (mlpack::ann::Gaussian).

Definition at line 49 of file radial_basis_function.hpp.

Constructor & Destructor Documentation

◆ RBFType() [1/4]

◆ RBFType() [2/4]

RBFType ( const size_t  outSize,
MatType &  centres,
double  betas = 0 
)

Create the Radial Basis Function layer object using the specified parameters.

Parameters
outSizeThe number of output units.
centresThe centres calculated using k-means of data.
betasThe beta value to be used with centres.

◆ ~RBFType()

◆ RBFType() [3/4]

RBFType ( const RBFType< MatType, Activation > &  other)

Copy the given RBFType layer.

◆ RBFType() [4/4]

RBFType ( RBFType< MatType, Activation > &&  other)

Take ownership of the given RBFType layer.

Member Function Documentation

◆ Backward()

void Backward ( const MatType &  ,
const MatType &  ,
MatType &   
)
virtual

Ordinary feed backward pass of the radial basis function.

Reimplemented from Layer< MatType >.

Referenced by RBFType< MatType, Activation >::~RBFType().

◆ Clone()

RBFType* Clone ( ) const
inlinevirtual

Clone the LinearType object. This handles polymorphism correctly.

Implements Layer< MatType >.

Definition at line 68 of file radial_basis_function.hpp.

References RBFType< MatType, Activation >::RBFType().

◆ ComputeOutputDimensions()

void ComputeOutputDimensions ( )
virtual

Compute the output dimensions of the layer given InputDimensions().

The RBFType layer flattens the input.

Reimplemented from Layer< MatType >.

Referenced by RBFType< MatType, Activation >::~RBFType().

◆ Forward()

void Forward ( const MatType &  input,
MatType &  output 
)
virtual

Ordinary feed forward pass of the radial basis function.

Parameters
inputInput data used for evaluating the specified function.
outputResulting output activation.

Reimplemented from Layer< MatType >.

Referenced by RBFType< MatType, Activation >::~RBFType().

◆ operator=() [1/2]

RBFType& operator= ( const RBFType< MatType, Activation > &  other)

Copy the given RBFType layer.

Referenced by RBFType< MatType, Activation >::~RBFType().

◆ operator=() [2/2]

RBFType& operator= ( RBFType< MatType, Activation > &&  other)

Take ownership of the given RBFType layer.

◆ serialize()

void serialize ( Archive &  ar,
const uint32_t   
)

Serialize the layer.

Referenced by RBFType< MatType, Activation >::WeightSize().

◆ WeightSize()

size_t WeightSize ( ) const
inlinevirtual

Get the size of the weights.

Reimplemented from Layer< MatType >.

Definition at line 102 of file radial_basis_function.hpp.

References RBFType< MatType, Activation >::serialize().


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