Fork me on GitHub

Load Module from ConfigΒΆ

In bolero, we can load modules (optimizers, behavior search methods, behaviors, environments) either from configuration dictionaries or from YAML files. This example shows how we can load an optimizer from a configuration dictionary.

print(__doc__)

from bolero.utils import from_dict


config = {
    "type": "bolero.optimizer.CMAESOptimizer",
    "variance": 10.0,
}

optimizer = from_dict(config)
optimizer.init(2)
params = [0, 0]
optimizer.get_next_parameters(params)
print(params)

Total running time of the script: ( 0 minutes 0.000 seconds)

Gallery generated by Sphinx-Gallery