IExperimentRun<T>

Interfaces · AiDotNet.Interfaces

Represents a single training run within an experiment.

Known implementations: ExperimentRun<T>

How It Works

For Beginners: A run represents one attempt at training a model with specific settings. Each run records everything about that training session: what settings you used (parameters), how well it performed (metrics), and what it created (artifacts like the trained model).

Think of a run like a single entry in a lab notebook - it captures all the details of one specific experiment attempt.

Properties

Property Summary
ConcurrentDictionary<string, string> Tags { get; } Gets the tags associated with this run.
DateTime StartTime { get; } Gets the timestamp when the run was started.
DateTime? EndTime { get; } Gets the timestamp when the run ended.
string ExperimentId { get; } Gets the experiment ID this run belongs to.
string RunId { get; } Gets the unique identifier for this run.
string RunName { get; set; } Gets or sets the name of this run.
string Status { get; } Gets the current status of the run (Running, Completed, Failed, etc.).

Methods

Method Summary
Dictionary<string, List<ValueTuple<int, T, DateTime>>> GetMetrics() Gets all metrics logged for this run.
Dictionary<string, object> GetParameters() Gets all parameters logged for this run.
List<ValueTuple<DateTime, string>> GetNotes() Gets all notes added to this run.
List<string> GetArtifacts() Gets all artifacts logged for this run.
T GetLatestMetric(string metricName) Gets the latest value for a specific metric.
void AddNote(string note) Adds a note or comment to the run.
void Complete() Marks the run as completed successfully.
void Fail(string errorMessage) Marks the run as failed with an optional error message.
void LogArtifact(string localPath, string artifactPath) Logs an artifact (file) associated with this run.
void LogArtifacts(string localDir, string artifactPath) Logs a directory of artifacts.
void LogMetric(string key, T value, int step, DateTime? timestamp) Logs a metric value at a specific step/iteration.
void LogMetrics(Dictionary<string, T> metrics, int step, DateTime? timestamp) Logs multiple metrics at once for a specific step.
void LogModel(IModel<TInput, TOutput, TMetadata> model, string artifactPath) Logs a trained model as an artifact.
void LogParameter(string key, object value) Logs a single parameter value for this run.
void LogParameters(Dictionary<string, object> parameters) Logs multiple parameters at once.