Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

BackpropTrainer Class Reference

Error back propagation neural learning algorithm. More...

#include <backprop.h>

Inheritance diagram for BackpropTrainer:

Trainer RPropTrainer List of all members.

Public Methods

virtual void init (const StringMap &params)

Protected Methods

virtual void initTrain (ANNetwork &network) const
virtual double trainOnce (ANNetwork &network, const PatternSet &set) const
virtual double trainPattern (ANNetwork &network, const PatternSet &set, int p) const
virtual void backpropagate (ANNetwork &network, const PatternSet &set, int p) const
virtual void updateWeights (ANNetwork &network) const

Protected Attributes

double mEta
double mMomentum
double mDecay
bool mBatchLearning
Vector mWeightDeltas
Vector mError

Detailed Description

Error back propagation neural learning algorithm.

Design Patterns: Template Method (various parts of the algorithm can be overloaded).

Definition at line 44 of file backprop.h.


Member Function Documentation

virtual void backpropagate ANNetwork   network,
const PatternSet   set,
int    p
const [protected, virtual]
 

Propagates an error signal backwards in the network.

Does not modify the network in any way, but stores the per-neuron error in mError.

Reimplemented in RPropTrainer.

Referenced by RPropTrainer::backpropagate(), and trainPattern().

void init const StringMap &    params [virtual]
 

This file is part of the Inanna library.

* * Copyright (C) 1997-2002 Marko Grönroos <magi@iki.fi> * *

* This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, Inc., 59 Temple Place *

  • Suite 330, Boston, MA 02111-1307, USA. * *

Reimplemented from Trainer.

Reimplemented in RPropTrainer.

Definition at line 37 of file backprop.cc.

References Trainer::init(), mBatchLearning, mDecay, mEta, and mMomentum.

void initTrain ANNetwork   network const [protected, virtual]
 

Initializes training.

Reimplemented from Trainer.

Reimplemented in RPropTrainer.

Definition at line 57 of file backprop.cc.

References Trainer::initTrain(), and mWeightDeltas.

Referenced by RPropTrainer::initTrain().

double trainOnce ANNetwork   network,
const PatternSet   set
const [protected, virtual]
 

Implementation for Trainer.

Reimplemented from Trainer.

Definition at line 71 of file backprop.cc.

References mBatchLearning, PatternSource::patterns, trainPattern(), and updateWeights().

double trainPattern ANNetwork   network,
const PatternSet   set,
int    p
const [protected, virtual]
 

Trains one pattern.

Definition at line 99 of file backprop.cc.

References backpropagate(), PatternSet::input(), PatternSource::inputs, PatternSet::output(), PatternSource::outputs, and ANNetwork::update().

Referenced by trainOnce().

virtual void updateWeights ANNetwork   network const [protected, virtual]
 

Updates weights after backpropagation phase.

Reimplemented in RPropTrainer.

Referenced by trainOnce().


Member Data Documentation

bool mBatchLearning [protected]
 

Should batch learning be used?

Definition at line 79 of file backprop.h.

Referenced by RPropTrainer::init(), init(), and trainOnce().

double mDecay [protected]
 

Weight decay multiplier.

Definition at line 76 of file backprop.h.

Referenced by RPropTrainer::init(), init(), and RPropTrainer::updateWeights().

Vector mError [protected]
 

Errors at each neuron.

We store these here, because we don't want to alter the network objects just because of the training algorithm.

Definition at line 93 of file backprop.h.

Referenced by RPropTrainer::backpropagate().

double mEta [protected]
 

Learning speed.

Definition at line 70 of file backprop.h.

Referenced by init().

double mMomentum [protected]
 

Momentum.

Definition at line 73 of file backprop.h.

Referenced by init().

Vector mWeightDeltas [protected]
 

Deltas for each weight in the network, in internal order.

We store these here, because we don't want to alter the network objects just because of the training algorithm.

Definition at line 86 of file backprop.h.

Referenced by RPropTrainer::initTrain(), initTrain(), and RPropTrainer::updateWeights().


The documentation for this class was generated from the following files:
Generated on Thu Feb 10 20:06:45 2005 for Inanna by doxygen1.2.18