Backpropagation<N extends num, E, T extends Signal<N, E, T> , S extends Scale<N> , P extends Sample<N, E, T, S> > class
Implementation of Backpropagation training algorithm.
Constructors
-
Backpropagation(ANN<
N, E, T, S> ann, SamplesSet<P> samplesSet, {String? subject})
Properties
- algorithmName → String
-
The training algorithm name.
finalinherited
-
ann
→ ANN<
N, E, T, S> -
The ANN to train.
finalinherited
- elapsedTime → Duration?
-
no setterinherited
- enableSelectInitialANN ↔ bool
-
If true will select the initial ANN calling selectInitialANN.
getter/setter pairinherited
- endTime → DateTime?
-
The end time of the last training session or null if not finished yet.
no setterinherited
- globalError → double
-
Returns the current training global error (set by train).
no setterinherited
- globalLearnError → double
-
The global error while updating weights.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialAnnEpochs ↔ int
-
Number of epochs to perform in the ANNs in the selection pool.
getter/setter pairinherited
- initialAnnPoolSize ↔ int
-
The initial ANN pool size.
getter/setter pairinherited
- lastGlobalError → double
-
no setterinherited
- lastGlobalLearnError → double
-
The previous global error while updating weights.
no setterinherited
- learningRate → double
-
Returns the current learning rate of the Backpropagation.
no setterinherited
- learningRateEntry → E
-
no setterinherited
- logEnabled ↔ bool
-
If true logging will be enabled.
getter/setter pairinherited
- logger → TrainingLogger
-
finalinherited
- logProgressEnabled ↔ bool
-
If true logging of progress will be enabled.
getter/setter pairinherited
- momentum → double
-
Returns the current momentum rate of the Backpropagation.
no setterinherited
- momentumEntry → E
-
no setterinherited
- noImprovementLimit → int
-
Limit of epochs without improvements. Used to trigger strategies.
no setterinherited
- noImprovementRatio ↔ double
-
Minimal improvement ratio.
getter/setter pairinherited
- parameters → String
-
no setterinherited
- random → Random
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
samples
→ List<
P> -
Returns the samples of samplesSet
no setterinherited
-
samplesSet
→ SamplesSet<
P> -
The samples set for training.
finalinherited
- samplesSubject → String
-
Returns the subject of samplesSet
no setterinherited
- signalInstance → T
-
no setterinherited
- startTime → DateTime?
-
The start time of the last training session or null if reset.
no setterinherited
- subject → String
-
The training subject. Defaults to
samplesSet.subject
.finalinherited - totalFailedEpochs → int
-
no setterinherited
- totalTrainedEpochs → int
-
Returns the total number of epochs of all the training session.
A call to reset won't reset this value.
no setterinherited
- totalTrainingActivations → int
-
Returns the total number of activations of all the training session.
A call to reset won't reset this value.
no setterinherited
- trainedEpochs → int
-
Returns the number of epochs of the last training session.
no setterinherited
- trainingActivations → int
-
Returns the number of activations of the last training session.
no setterinherited
- trainingSamplesSize → int
-
no setterinherited
Methods
-
checkBestTrainingError(
double trainingError) → void -
inherited
-
computeEntryWeightUpdate(
E weight, E weightLastUpdate, E gradient, E previousGradient, T previousUpdateDeltas, T noImprovementCounter, int weightsEntryIndex, E neuronOutput) → E -
computeEntryWeightUpdateSIMD(
E weight, E weightLastUpdate, E gradient, E previousGradient, T previousUpdateDeltas, T noImprovementCounter, int weightsEntryIndex, E neuronOutput) → E - Implementation of the weight update for an entry (SIMD).
-
computeGlobalError(
List< P> samples) → double -
inherited
-
computeWeightUpdate(
N weight, N weightLastUpdate, num gradient, num previousGradient, List< num> previousUpdateDeltas, List<num> noImprovementCounter, int weightIndex, N neuronOutput) → double - Implementation of the weight update.
-
createLearningRateStrategy(
) → ParameterStrategy< N, E, T> -
inherited
-
createMomentumStrategy(
) → ParameterStrategy< N, E, T> -
inherited
-
generateRandomValue(
double range) → double -
inherited
-
generateRandomValuePositive(
double range) → double -
inherited
-
generateRandomWeightUpdate(
double range, double min, double max, double multiplier) → double -
inherited
-
generateRandomWeightUpdateByFactor(
double weight, double factor, {double zeroPoint = 0.01, double multiplier = 1.0}) → double -
inherited
-
initializeParameters(
) → void -
Initialize training parameters.
inherited
-
initializeTraining(
) → void -
inherited
-
learn(
List< P> samples, double targetGlobalError) → bool -
Learn the training of
sample
. Called by train.inherited -
logError(
String message, [dynamic error, StackTrace? stackTrace]) → void -
inherited
-
logInfo(
String message) → void -
inherited
-
logProgress(
String message) → void -
inherited
-
logWarn(
String message) → void -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void -
Reset this instance for a future training sessions.
inherited
-
selectInitialANN(
List< P> samples, double targetGlobalError, [Random? random]) → void -
Selects the initial ANN.
inherited
-
setLearningRate(
double learningRate) → void -
inherited
-
setMomentum(
double momentum) → void -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
train(
int epochs, double targetGlobalError) → double -
Train the samples for n
epochs
and returns the last global error.inherited -
trainUntilGlobalError(
{double? targetGlobalError, int epochsBlock = 50, int maxEpochs = 1000000, double maxEpochsLimitRatio = 3, int maxRetries = 5, double retryIncreaseMaxEpochsRatio = 1.50, Random? random}) → bool -
Train the ann until
targetGlobalError
, withmaxEpochs
per training session and amaxRetries
when a training session can't reach the target global error.inherited -
updateParameters(
) → void -
Update training parameters.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited