LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Types | Public Member Functions | List of all members
rcsc::BPNetwork1< INPUT, HIDDEN, OUTPUT, FuncH, FuncO > Class Template Reference

Back Propagetion Neural Network. More...

#include <bpn1.h>

Public Types

typedef double value_type
 typedef of the value type
 
typedef std::array< value_type, INPUT > input_array
 typedef of the input array type that uses template parameter.
 
typedef std::array< value_type, OUTPUT > output_array
 typedef of the output array type that uses template parameter.
 

Public Member Functions

 BPNetwork1 ()
 default constructor More...
 
 BPNetwork1 (const value_type &eta, const value_type &alpha)
 create with learning parameter More...
 
template<typename RNG >
 BPNetwork1 (const value_type &eta, const value_type &alpha, RNG &rng)
 create with random number generator More...
 
void init ()
 init member variables
 
template<typename RNG >
void randomize (RNG &rng)
 create unit connection randomly More...
 
void propagate (const input_array &input, output_array &output) const
 simulate network. More...
 
value_type train (const input_array &input, const output_array &teacher)
 update unit connection weights using teacher signal More...
 
bool read (std::istream &is)
 read network structure from input stream. More...
 
std::ostream & print (std::ostream &os) const
 put network structure to stream by "one" line More...
 

Detailed Description

template<std::size_t INPUT, std::size_t HIDDEN, std::size_t OUTPUT, typename FuncH = SigmoidFunc, typename FuncO = SigmoidFunc>
class rcsc::BPNetwork1< INPUT, HIDDEN, OUTPUT, FuncH, FuncO >

Back Propagetion Neural Network.

This class can take only one hidden layer, but unit number and activation function can be specified by template parameters.

Constructor & Destructor Documentation

◆ BPNetwork1() [1/3]

template<std::size_t INPUT, std::size_t HIDDEN, std::size_t OUTPUT, typename FuncH = SigmoidFunc, typename FuncO = SigmoidFunc>
rcsc::BPNetwork1< INPUT, HIDDEN, OUTPUT, FuncH, FuncO >::BPNetwork1 ( )
inline

default constructor

default training parameter is set.

◆ BPNetwork1() [2/3]

template<std::size_t INPUT, std::size_t HIDDEN, std::size_t OUTPUT, typename FuncH = SigmoidFunc, typename FuncO = SigmoidFunc>
rcsc::BPNetwork1< INPUT, HIDDEN, OUTPUT, FuncH, FuncO >::BPNetwork1 ( const value_type eta,
const value_type alpha 
)
inline

create with learning parameter

Parameters
etatraining parameter
alphatraining parameter

◆ BPNetwork1() [3/3]

template<std::size_t INPUT, std::size_t HIDDEN, std::size_t OUTPUT, typename FuncH = SigmoidFunc, typename FuncO = SigmoidFunc>
template<typename RNG >
rcsc::BPNetwork1< INPUT, HIDDEN, OUTPUT, FuncH, FuncO >::BPNetwork1 ( const value_type eta,
const value_type alpha,
RNG &  rng 
)
inline

create with random number generator

Parameters
etatraining parameter
alphatraining parameter
rngreferenct to the random number generator object

Member Function Documentation

◆ print()

template<std::size_t INPUT, std::size_t HIDDEN, std::size_t OUTPUT, typename FuncH = SigmoidFunc, typename FuncO = SigmoidFunc>
std::ostream & rcsc::BPNetwork1< INPUT, HIDDEN, OUTPUT, FuncH, FuncO >::print ( std::ostream &  os) const
inline

put network structure to stream by "one" line

Parameters
osreference to the output stream
Returns
reference to the output stream

◆ propagate()

template<std::size_t INPUT, std::size_t HIDDEN, std::size_t OUTPUT, typename FuncH = SigmoidFunc, typename FuncO = SigmoidFunc>
void rcsc::BPNetwork1< INPUT, HIDDEN, OUTPUT, FuncH, FuncO >::propagate ( const input_array input,
output_array output 
) const
inline

simulate network.

Parameters
inputinput data
outputreference to the data holder variable

◆ randomize()

template<std::size_t INPUT, std::size_t HIDDEN, std::size_t OUTPUT, typename FuncH = SigmoidFunc, typename FuncO = SigmoidFunc>
template<typename RNG >
void rcsc::BPNetwork1< INPUT, HIDDEN, OUTPUT, FuncH, FuncO >::randomize ( RNG &  rng)
inline

create unit connection randomly

Parameters
rngreferenct to the random number generator object

◆ read()

template<std::size_t INPUT, std::size_t HIDDEN, std::size_t OUTPUT, typename FuncH = SigmoidFunc, typename FuncO = SigmoidFunc>
bool rcsc::BPNetwork1< INPUT, HIDDEN, OUTPUT, FuncH, FuncO >::read ( std::istream &  is)
inline

read network structure from input stream.

Parameters
isreference to the input stream
Returns
true if successfully ended.

◆ train()

template<std::size_t INPUT, std::size_t HIDDEN, std::size_t OUTPUT, typename FuncH = SigmoidFunc, typename FuncO = SigmoidFunc>
value_type rcsc::BPNetwork1< INPUT, HIDDEN, OUTPUT, FuncH, FuncO >::train ( const input_array input,
const output_array teacher 
)
inline

update unit connection weights using teacher signal

Parameters
inputinput data
teacherteaching signal data

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