lingvo.base_trial module
Defines trials for parameter exploration.
- class lingvo.base_trial.Trial(params)[source]
Bases:
objectBase class for a trial.
- property report_interval_seconds
- property objective_metric_key
- OverrideModelParams(model_params)[source]
Modifies
model_paramsaccording to trial params.Through this method a
Trialmay tweak model hyperparams (e.g., learning rate, shape, depth, or width of networks).- Parameters
model_params – the original model hyperparams.
- Returns
The modified
model_params.
- class lingvo.base_trial.NoOpTrial[source]
Bases:
TrialA Trial implementation that does nothing.
- OverrideModelParams(model_params)[source]
Modifies
model_paramsaccording to trial params.Through this method a
Trialmay tweak model hyperparams (e.g., learning rate, shape, depth, or width of networks).- Parameters
model_params – the original model hyperparams.
- Returns
The modified
model_params.
- exception lingvo.base_trial.TunerManagedError[source]
Bases:
BaseExceptionBase class for error that should be propagated to the tuner.
In base_runner.py, the training loop catchs all exceptions and treats unknown errors as failure. However, in some cases (e.g. PyGlove uses an EarlyStoppingError to signal early stopping that might take place at any moment), it requires the error to propagate to the tuner. This class is a base for such errors.