Trial¶
Container class for Trial
entity¶
Describe a particular training run, parameters and results.
-
class
orion.core.worker.trial.
Trial
(**kwargs)[source]¶ Represents an entry in database/trials collection.
- Attributes
- experimentstr
Unique identifier for the experiment that produced this trial. Same as an Experiment._id.
- id_override: str
Trial id returned by the database. It should be unique for a given set of parameters
- heartbeatdatetime.datetime
Last time trial was identified as being alive.
status
strFor meaning of property type, see
Trial.status
.- workerstr
Corresponds to worker’s unique id that handled this trial.
- submit_time
datetime.datetime
When was this trial suggested?
- start_time
datetime.datetime
When was this trial first reserved?
- end_time
datetime.datetime
When was this trial evaluated successfully?
results
list ofTrial.Result
List of results of the trial
params
dict of paramsParameters of the trial
Methods
Param
(**kwargs)Types for a
Param
can be either an integer (discrete value), floating precision numerical or a categorical expression (e.g.Result
(**kwargs)Types for a
Result
can be either an evaluation of an ‘objective’ function or of an ‘constraint’ expression.Value
(**kwargs)Container for a value object.
build
(trial_entries)Builder method for a list of trials.
compute_trial_hash
(trial[, ignore_fidelity, …])Generate a unique param md5sum hash for a given
Trial
format_params
(params[, sep, ignore_fidelity])Represent with a string the parameters contained in this
Trial
object.format_values
(values[, sep])Represent with a string the given values.
params_repr
([sep, ignore_fidelity])Represent with a string the parameters contained in this
Trial
object.to_dict
()Needed to be able to convert
Trial
to dict form.-
class
Param
(**kwargs)[source]¶ Types for a Param can be either an integer (discrete value), floating precision numerical or a categorical expression (e.g. a string).
-
class
Result
(**kwargs)[source]¶ Types for a Result can be either an evaluation of an ‘objective’ function or of an ‘constraint’ expression.
-
class
Value
(**kwargs)[source]¶ Container for a value object.
- Attributes
- namestr
A possible named for the quality that this is quantifying.
type
strFor meaning of property type, see Value.type.
- valuestr or numerical
value suggested for this dimension of the parameter space.
Methods
to_dict
()Needed to be able to convert Value to dict form.
-
__hash__
= None¶
-
__repr__
()¶ Represent partially with a string.
-
property
type
¶ For meaning of property type, see Value.type.
-
__repr__
()¶ Represent partially with a string.
-
classmethod
build
(trial_entries)[source]¶ Builder method for a list of trials.
- Parameters
trial_entries – List of trial representation in dictionary form, as expected to be saved in a database.
- Returns
a list of corresponding
Trial
objects.
-
static
compute_trial_hash
(trial, ignore_fidelity=False, ignore_experiment=False, ignore_lie=False)[source]¶ Generate a unique param md5sum hash for a given
Trial
-
property
constraints
¶ Return this trial’s constraints
- Returns
- A list of
Trial.Result
of type ‘constraint’
- A list of
-
static
format_params
(params, sep=',', ignore_fidelity=False)[source]¶ Represent with a string the parameters contained in this
Trial
object.
-
property
full_name
¶ Generate a unique name using the full definition of parameters.
-
property
gradient
¶ Return this trial’s gradient value if it is evaluated, else None.
- Return type
-
property
hash_params
¶ Generate a unique param md5sum hash for this
Trial
.Note
The params contributing to the hash do not include the fidelity.
-
property
id
¶ Return hash_name which is also the database key
_id
.
-
property
lie
¶ Return this trial’s fake objective value if it was set, else None.
- Return type
-
property
objective
¶ Return this trial’s objective value if it is evaluated, else None.
- Return type
-
property
params
¶ Parameters of the trial
-
params_repr
(sep=',', ignore_fidelity=False)[source]¶ Represent with a string the parameters contained in this
Trial
object.
-
property
results
¶ List of results of the trial
-
property
statistics
¶ Return this trial’s statistics
- Returns
- A list of
Trial.Result
de type ‘statistic’
- A list of
-
property
status
¶ For meaning of property type, see
Trial.status
.
-
property
working_dir
¶ Return the current working directory of the trial.