Class HyperparameterTrial<T>
Represents a single trial in hyperparameter optimization.
public class HyperparameterTrial<T>
Type Parameters
TThe 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
trialNumberint
Properties
EndTime
Gets or sets the end time of the trial.
public DateTime? EndTime { get; set; }
Property Value
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
StartTime
Gets or sets the start time of the trial.
public DateTime StartTime { get; set; }
Property Value
Status
Gets or sets the status of the trial.
public TrialStatus Status { get; set; }
Property Value
SystemAttributes
Gets or sets system attributes for the trial.
public Dictionary<string, object> SystemAttributes { get; set; }
Property Value
TrialId
Gets the unique identifier for this trial.
public string TrialId { get; }
Property Value
TrialNumber
Gets the trial number (sequential).
public int TrialNumber { get; set; }
Property Value
UserAttributes
Gets or sets user attributes for the trial.
public Dictionary<string, object> UserAttributes { get; set; }
Property Value
Methods
Complete(T)
Marks the trial as complete with the final objective value.
public void Complete(T objectiveValue)
Parameters
objectiveValueT
Fail()
Marks the trial as failed.
public void Fail()
GetDuration()
Gets the duration of the trial.
public TimeSpan? GetDuration()
Returns
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
stepintvalueT