Copiste  0.1
 All Classes Functions Variables Enumerations Friends Pages
Public Member Functions | Friends
NeuralNetwork Class Reference

A slightly better neural network. More...

#include <neuralnetwork.h>

List of all members.

Public Member Functions

 NeuralNetwork (std::string file="")
 Loads a neural network from a file if specified.
void reset (std::vector< int > geometry)
 Creates a fresh network with given input and hidden layer sizes) The output layer is always a single neuron). geometry[i] stores the size of the ith layer (not counting the bias unit) The last integer is the size of the last hidden layer.
bool fromFile (std::string file)
 Loads a network from a file. Returns true if it succeded.
bool toFile (std::string file)
 Save the current network to a file.
double train (Corpus &c, double rate, double regularization, int nbIter, bool debug=false)
 Train the network on a corpus.
double classify (std::vector< double > input)
 Get the output of the network on a given input.
double accuracy (Corpus &c)
 See how well the network does on a given corpus (between 0, not accurate, and 1, accurate)
void randomize ()
 Randomize the weights of the network.
unsigned int nbLayers ()
 Parameters.
unsigned int dimension ()
 Input dimension of the network (size of the input layer)

Friends

class boost::serialization::access
 Internal usage : for load and save.

Detailed Description

A slightly better neural network.


Member Function Documentation

unsigned int NeuralNetwork::dimension ( )

Input dimension of the network (size of the input layer)

Return the input dimension of the network.

unsigned int NeuralNetwork::nbLayers ( )
inline

Parameters.

Number of layers of the network (hidden layers + output layer)

void NeuralNetwork::reset ( std::vector< int >  geometry)

Creates a fresh network with given input and hidden layer sizes) The output layer is always a single neuron). geometry[i] stores the size of the ith layer (not counting the bias unit) The last integer is the size of the last hidden layer.

Creates a fresh network with given input and hidden layer sizes (the output layer is always a single neuron)


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