optuna.integration.AllenNLPExecutor¶
-
class
optuna.integration.AllenNLPExecutor(trial: optuna.trial._trial.Trial, config_file: str, serialization_dir: str, metrics: str = 'best_validation_accuracy', *, include_package: Union[str, List[str], None] = None)[source]¶ AllenNLP extension to use optuna with Jsonnet config file.
This feature is experimental since AllenNLP major release will come soon. The interface may change without prior notice to correspond to the update.
See the examples of objective function and config file.
- Parameters
trial – A
Trialcorresponding to the current evaluation of the objective function.config_file – Config file for AllenNLP. Hyperparameters should be masked with
std.extVar. Please refer to the config example.serialization_dir – A path which model weights and logs are saved.
metrics – An evaluation metric for the result of
objective.include_package – Additional packages to include. For more information, please see AllenNLP documentation.
Note
Added in v1.4.0 as an experimental feature. The interface may change in newer versions without prior notice. See https://github.com/optuna/optuna/releases/tag/v1.4.0.
-
__init__(trial: optuna.trial._trial.Trial, config_file: str, serialization_dir: str, metrics: str = 'best_validation_accuracy', *, include_package: Union[str, List[str], None] = None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__(trial, config_file, serialization_dir)Initialize self.
run()Train a model using AllenNLP.