Hyperparameter tuning
Project description
# autotune
Hyperparameter tuning on GPUs
[![Build Status](https://travis-ci.org/vzhong/autotune.svg?branch=master)](https://travis-ci.org/vzhong/autotune)
## Installation
```bash
pip install git+git://github.com/vzhong/autotune.git
# Or get it straight from PyPI
pip install autotune
```
## Usage
You can use the binary:
```bash
autotune -h
```
Or use it programmatically:
```python
from autotune.tuner import RandomSearch
from autotune.spec import Spec
config = Spec.load('myconf.json')
tuner = RandomSearch('myprog.bin', config)
tuner.tune(2, out='output')
```
where `myconf.json` looks something like:
```json
{
"foo": [-1, 1],
"bar": [2.0, 3.0]
}
```
This will run 2 commands `myprog.bin --foo $FOO --bar $BAR` where `$FOO` is an integer sampled between `-1` and `1` and `$BAR` is a float sampled between `2.0` and `3.0`.
You can pass in an optional parameter `name='nickname'`, which will add to the command `--nickname $HASH`, where `$HASH` is a hash of the specific parameters used for this command.
You can also pass in an optional parameter `gpu=True`, which will queue jobs onto aavailable GPUs.
The command then becomes `CUDA_VISIBLE_DEVICES=$GPU myprog.bin --foo $FOO --bar $BAR --gpu 0`, where `$GPU` is a free GPU (e.g. no memory usage).
Hyperparameter tuning on GPUs
[![Build Status](https://travis-ci.org/vzhong/autotune.svg?branch=master)](https://travis-ci.org/vzhong/autotune)
## Installation
```bash
pip install git+git://github.com/vzhong/autotune.git
# Or get it straight from PyPI
pip install autotune
```
## Usage
You can use the binary:
```bash
autotune -h
```
Or use it programmatically:
```python
from autotune.tuner import RandomSearch
from autotune.spec import Spec
config = Spec.load('myconf.json')
tuner = RandomSearch('myprog.bin', config)
tuner.tune(2, out='output')
```
where `myconf.json` looks something like:
```json
{
"foo": [-1, 1],
"bar": [2.0, 3.0]
}
```
This will run 2 commands `myprog.bin --foo $FOO --bar $BAR` where `$FOO` is an integer sampled between `-1` and `1` and `$BAR` is a float sampled between `2.0` and `3.0`.
You can pass in an optional parameter `name='nickname'`, which will add to the command `--nickname $HASH`, where `$HASH` is a hash of the specific parameters used for this command.
You can also pass in an optional parameter `gpu=True`, which will queue jobs onto aavailable GPUs.
The command then becomes `CUDA_VISIBLE_DEVICES=$GPU myprog.bin --foo $FOO --bar $BAR --gpu 0`, where `$GPU` is a free GPU (e.g. no memory usage).
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file autotune-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: autotune-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a1abde434d646051c796f372efc879a8276af3a4ccfd5711432fb63bf6dc93a |
|
MD5 | e0423cd9a5d82cd69b4277215039cef4 |
|
BLAKE2b-256 | 813d3c4d047e1e921a1dd91a80f81acb2c55968b7da54f2098ba2faf31a7857b |