feat: add trial user attributes for logging and analysis
Add AttrValue enum (Float, Int, String, Bool) with From impls and set_user_attr/user_attr/user_attrs methods on both Trial and CompletedTrial. Attributes set during optimization are propagated through complete_trial and prune_trial. AttrValue is re-exported at crate root and in the prelude.
This commit is contained in:
@@ -363,6 +363,7 @@ where
|
||||
trial.param_labels().clone(),
|
||||
value,
|
||||
trial.intermediate_values().to_vec(),
|
||||
trial.user_attrs().clone(),
|
||||
);
|
||||
completed.state = TrialState::Complete;
|
||||
self.completed_trials.write().push(completed);
|
||||
@@ -471,6 +472,7 @@ where
|
||||
trial.param_labels().clone(),
|
||||
V::default(),
|
||||
trial.intermediate_values().to_vec(),
|
||||
trial.user_attrs().clone(),
|
||||
);
|
||||
completed.state = TrialState::Pruned;
|
||||
self.completed_trials.write().push(completed);
|
||||
|
||||
Reference in New Issue
Block a user