Conf-Generator is a tool for specifying and exploring hyper-parameters sets in Machine Learning pipelines defined through configuration files.
Project description
Conf-Generator is a tool for specifying and exploring hyper-parameters sets in Machine Learning pipelines defined through configuration files.
A typical configuration instance to train a model would look like this:
model: resnet
learning_rate: 0.01
training_epochs: 10
With Conf-Generator it is possible to specify multiple configurations representing parameter exploration:
model: resnet
$learning_rate: [0.01, 0.005]
$training_epochs: [10, 20]
The $
prefix is used to specify the varying parameters. The configurations can be generated with the following snippet:
from conf_generator import ConfGenerator
exp = ConfGenerator("some/config.yml")
for conf, summary in exp.generate():
print(conf)
The generator generates the configurations as python dictionary objects:
{'learning_rate': 0.01, 'training_epochs': 10, 'model': 'resnet'}
{'learning_rate': 0.01, 'training_epochs': 20, 'model': 'resnet'}
{'learning_rate': 0.005, 'training_epochs': 10, 'model': 'resnet'}
{'learning_rate': 0.005, 'training_epochs': 20, 'model': 'resnet'}
The cartesian product is made over the varying parameters if those are defined using lists, we can tie them using dictionaries:
model: resnet
$learning_rate: {a:0.01, b:0.005}
$training_epochs: {a:10, b:20}
Output:
{'learning_rate': 0.01, 'training_epochs': 10, 'model': 'resnet'}
{'learning_rate': 0.005, 'training_epochs': 20, 'model': 'resnet'}
Keys can be joined using |
:
model: resnet
$learning_rate: {a: 0.01, b: 0.001, c: 0.1}
$training_epochs: {a|b: 20, c: 10}
Output:
{'learning_rate': 0.01, 'training_epochs': 20, 'model': 'resnet'}
{'learning_rate': 0.001, 'training_epochs': 20, 'model': 'resnet'}
{'learning_rate': 0.1, 'training_epochs': 10, 'model': 'resnet'}
Nesting is possible:
model: resnet
$$learning_rate: [{a: 0.01, b: 0.001}, {a: 0.05, b: 0.005}]
$training_epochs: {a: 10, b: 20}
Output:
{'learning_rate': 0.01, 'model': 'resnet', 'training_epochs': 10}
{'learning_rate': 0.05, 'model': 'resnet', 'training_epochs': 10}
{'learning_rate': 0.001, 'model': 'resnet', 'training_epochs': 20}
{'learning_rate': 0.005, 'model': 'resnet', 'training_epochs': 20}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file conf-generator-1.0.1.tar.gz
.
File metadata
- Download URL: conf-generator-1.0.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 999f3cf73da43849cac43af39d898bc1b54ba8fc250fd9cb181637891a863790 |
|
MD5 | 8f251660eb83f73dcfa831a518b8cbca |
|
BLAKE2b-256 | dddb4be0fb525067a84f5b7d0bab2cd995236237e374f5b9e5174cb1a8c1c600 |
File details
Details for the file conf_generator-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: conf_generator-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b21e5ff1d69ecac70ba6830ccc71c42ebf5e8920b37e5bf290d82eca5d3e911f |
|
MD5 | 4df80be922f4bbe466eafd8b98c70136 |
|
BLAKE2b-256 | ac866baf0fcd0dd089863f22575e832f53c306d55569445fd3b98701cd9a28a0 |