Table of Contents

Class HyperparameterTrial<T>

Namespace
AiDotNet.Models
Assembly
AiDotNet.dll

Represents a single trial in hyperparameter optimization.

public class HyperparameterTrial<T>

Type Parameters

T

The numeric data type used for calculations.

Inheritance
HyperparameterTrial<T>
Inherited Members

Remarks

For Beginners: A trial is one attempt at training with a specific set of hyperparameters. The optimizer tries many trials to find the best hyperparameter values.

Constructors

HyperparameterTrial(int)

Initializes a new instance of the HyperparameterTrial class.

public HyperparameterTrial(int trialNumber)

Parameters

trialNumber int

Properties

EndTime

Gets or sets the end time of the trial.

public DateTime? EndTime { get; set; }

Property Value

DateTime?

IntermediateValues

Gets or sets intermediate values logged during training.

public Dictionary<int, T> IntermediateValues { get; set; }

Property Value

Dictionary<int, T>

Remarks

For Beginners: Intermediate values are measurements taken during training, used for pruning (stopping unpromising trials early).

ObjectiveValue

Gets or sets the objective value achieved (e.g., validation accuracy).

public T? ObjectiveValue { get; set; }

Property Value

T

Parameters

Gets or sets the hyperparameter values for this trial.

public Dictionary<string, object> Parameters { get; set; }

Property Value

Dictionary<string, object>

StartTime

Gets or sets the start time of the trial.

public DateTime StartTime { get; set; }

Property Value

DateTime

Status

Gets or sets the status of the trial.

public TrialStatus Status { get; set; }

Property Value

TrialStatus

SystemAttributes

Gets or sets system attributes for the trial.

public Dictionary<string, object> SystemAttributes { get; set; }

Property Value

Dictionary<string, object>

TrialId

Gets the unique identifier for this trial.

public string TrialId { get; }

Property Value

string

TrialNumber

Gets the trial number (sequential).

public int TrialNumber { get; set; }

Property Value

int

UserAttributes

Gets or sets user attributes for the trial.

public Dictionary<string, object> UserAttributes { get; set; }

Property Value

Dictionary<string, object>

Methods

Complete(T)

Marks the trial as complete with the final objective value.

public void Complete(T objectiveValue)

Parameters

objectiveValue T

Fail()

Marks the trial as failed.

public void Fail()

GetDuration()

Gets the duration of the trial.

public TimeSpan? GetDuration()

Returns

TimeSpan?

Prune()

Marks the trial as pruned (stopped early).

public void Prune()

ReportIntermediateValue(int, T)

Reports an intermediate value for a training step.

public void ReportIntermediateValue(int step, T value)

Parameters

step int
value T