MetaTrainingResult<T>
Models & Types · AiDotNet.Models.Results
Results from a complete meta-training run with history tracking.
For Beginners
Meta-training is the process of training your model to be good at learning new tasks quickly. This happens over many iterations:
- Sample a batch of tasks
- Adapt to each task (inner loop)
- Update meta-parameters based on how well adaptations worked (outer loop)
- Repeat for many iterations
This result tracks:
- Learning curves: How loss and accuracy change over iterations
- Final performance: The end results after training
- Training time: How long it took
- Convergence: Whether training successfully improved the model
Use this to:
- Monitor training progress
- Diagnose training issues
- Compare different meta-learning configurations
- Report results in papers or documentation
How It Works
This class aggregates metrics across an entire meta-training session, tracking how performance evolves over many meta-iterations. It combines the functionality of what were previously separate “Metrics” and “Metadata” classes into a unified Result pattern consistent with the codebase.
Constructors
| Constructor | Summary |
|---|---|
MetaTrainingResult(Vector<T> lossHistory, Vector<T> accuracyHistory, TimeSpan trainingTime, Dictionary<string, T> additionalMetrics) |
Initializes a new instance with complete training history. |
Properties
| Property | Summary |
|---|---|
Dictionary<string, T> AdditionalMetrics { get; } |
Gets algorithm-specific metrics collected during training. |
T FinalAccuracy { get; } |
Gets the final accuracy after training. |
T FinalLoss { get; } |
Gets the final meta-loss after training. |
T InitialAccuracy { get; } |
Gets the initial accuracy before training. |
T InitialLoss { get; } |
Gets the initial meta-loss before training. |
TimeSpan TrainingTime { get; } |
Gets the total time taken for meta-training. |
Vector<T> AccuracyHistory { get; } |
Gets the accuracy history across all iterations. |
Vector<T> LossHistory { get; } |
Gets the meta-loss history across all iterations. |
int TotalIterations { get; } |
Gets the total number of meta-training iterations completed. |
Methods
| Method | Summary |
|---|---|
T CalculateAccuracyImprovement() |
Calculates the total improvement in accuracy from start to finish. |
T CalculateLossImprovement() |
Calculates the total improvement in loss from start to finish. |
ValueTuple<T, int> FindBestAccuracy() |
Finds the best (highest) accuracy achieved during training. |
ValueTuple<T, int> FindBestLoss() |
Finds the best (lowest) loss achieved during training. |
bool HasConverged(int windowSize, double varianceThreshold) |
Checks if training converged based on loss stabilization. |
string GenerateReport() |
Generates a comprehensive training report. |