Fido
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
net::Layer Class Reference

A layer in a NeuralNet. More...

#include <Layer.h>

Public Member Functions

 Layer ()
 Initialize a layer with the default sigmoid activation function. More...
 
 Layer (std::ifstream *input)
 Initialize a layer from a saved text file. More...
 
void setActivationFunctionWithName (std::string name)
 Sets the activation function to the given string. More...
 
std::string getActivationFunctionName ()
 Gets the name of the layer's activation function. More...
 
void store (std::ofstream *output)
 Store the layer to a text file. More...
 

Static Public Member Functions

static std::map< std::string,
ActivationFunction
getActivationFunctionNameMap ()
 Gets the map of activation function name to ActivationFunction. More...
 
static std::map< std::string,
ActivationFunction
getDerivedActivationFunctionNames ()
 Gets the map of activation function name to a derived ActivationFunction. More...
 

Public Attributes

ActivationFunction activationFunction
 The activation function for the neurons of this layer. More...
 
std::vector< Neuronneurons
 Holds the neurons of this layer. More...
 

Detailed Description

A layer in a NeuralNet.

Constructor & Destructor Documentation

Layer::Layer ( )

Initialize a layer with the default sigmoid activation function.

Layer::Layer ( std::ifstream *  input)
explicit

Initialize a layer from a saved text file.

The saved text file must be formatted as outputted by the storeNetWithStream(std::ofstream *output) function.

Parameters
inputthe text file for the Layer object to be initialized from

Member Function Documentation

std::string Layer::getActivationFunctionName ( )

Gets the name of the layer's activation function.

static std::map<std::string, ActivationFunction> net::Layer::getActivationFunctionNameMap ( )
inlinestatic

Gets the map of activation function name to ActivationFunction.

static std::map<std::string, ActivationFunction> net::Layer::getDerivedActivationFunctionNames ( )
inlinestatic

Gets the map of activation function name to a derived ActivationFunction.

void Layer::setActivationFunctionWithName ( std::string  name)

Sets the activation function to the given string.

Parameters
namethe name of the activation function
void Layer::store ( std::ofstream *  output)

Store the layer to a text file.

This can later be read by the Layer(std::ifstream *input) constructor.

Parameters
outputthe text file for the layer object to be written to

Member Data Documentation

ActivationFunction net::Layer::activationFunction

The activation function for the neurons of this layer.

An activation function takes the summation of the inputs times the weights of a neuron and uses an activation value of 0 to filter the output

std::vector<Neuron> net::Layer::neurons

Holds the neurons of this layer.


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