Training<N extends num, E, T extends Signal<N, E, T> , S extends Scale<N> , P extends Sample<N, E, T, S> > class
abstract
Base class for training algorithms.
- Implementers
Constructors
-
Training(ANN<
N, E, T, S> ann, SamplesSet<P> samplesSet, String algorithmName, {String? subject, TrainingLogger? logger})
Properties
- algorithmName → String
-
The training algorithm name.
final
-
ann
→ ANN<
N, E, T, S> -
The ANN to train.
final
- elapsedTime → Duration?
-
no setter
- enableSelectInitialANN ↔ bool
-
If true will select the initial ANN calling selectInitialANN.
getter/setter pair
- endTime → DateTime?
-
The end time of the last training session or null if not finished yet.
no setter
- globalError → double
-
Returns the current training global error (set by train).
no setter
- 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 pair
- initialAnnPoolSize ↔ int
-
The initial ANN pool size.
getter/setter pair
- lastGlobalError → double
-
no setter
- logEnabled ↔ bool
-
If true logging will be enabled.
getter/setter pair
- logger → TrainingLogger
-
final
- logProgressEnabled ↔ bool
-
If true logging of progress will be enabled.
getter/setter pair
- parameters → String
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
samples
→ List<
P> -
Returns the samples of samplesSet
no setter
-
samplesSet
→ SamplesSet<
P> -
The samples set for training.
final
- samplesSubject → String
-
Returns the subject of samplesSet
no setter
- startTime → DateTime?
-
The start time of the last training session or null if reset.
no setter
- subject → String
-
The training subject. Defaults to
samplesSet.subject
.final - totalFailedEpochs → int
-
no setter
- totalTrainedEpochs → int
-
Returns the total number of epochs of all the training session.
A call to reset won't reset this value.
no setter
- totalTrainingActivations → int
-
Returns the total number of activations of all the training session.
A call to reset won't reset this value.
no setter
- trainedEpochs → int
-
Returns the number of epochs of the last training session.
no setter
- trainingActivations → int
-
Returns the number of activations of the last training session.
no setter
- trainingSamplesSize → int
-
no setter
Methods
-
checkBestTrainingError(
double trainingError) → void -
computeGlobalError(
List< P> samples) → double -
initializeParameters(
) → void - Initialize training parameters.
-
initializeTraining(
) → void -
learn(
List< P> samples, double targetGlobalError) → bool -
Learn the training of
sample
. Called by train. -
logError(
String message, [dynamic error, StackTrace? stackTrace]) → void -
logInfo(
String message) → void -
logProgress(
String message) → void -
logWarn(
String message) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void - Reset this instance for a future training sessions.
-
selectInitialANN(
List< P> samples, double targetGlobalError, [Random? random]) → void - Selects the initial ANN.
-
toString(
) → String -
A string representation of this object.
override
-
train(
int epochs, double targetGlobalError) → double -
Train the samples for n
epochs
and returns the last global error. -
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. -
updateParameters(
) → void - Update training parameters.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited