Metadata-Version: 2.3
Name: superparams
Version: 0.0.1
Summary: Create hyperparam combinations with dataclasses
Project-URL: Homepage, https://github.com/Ar4l/param-search
Project-URL: Issues, https://github.com/Ar4l/param-search/issues
Author-email: Aral <me@aral.cc>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.11
Description-Content-Type: text/markdown

## superparams
a Pythonic approach to Hyperparameter Search. Using built-in `dataclasses`, as they are flexible, typed, easily-serialisable, and are a `dict` in the places you need them. 

#### Usage 
```python 
from dataclasses import dataclass
from hyperparameters import GridSearch, search

@dataclass
class Hyperparams(GridSearch):

    epochs        :int = 3 
    batch_size    :int = search([16, 32])
    learning_rate :int = search([1e-5, 2e-5])
```

This inherits a bunch of useful attributes, and constructs an iterator. 

```python
for h in Hyperparams():
    print(h)

# Outputs: 
# Hyperparams(epochs=3, batch_size=16, learning_rate=1e-05)
# Hyperparams(epochs=3, batch_size=16, learning_rate=2e-05)
# Hyperparams(epochs=3, batch_size=32, learning_rate=1e-05)
# Hyperparams(epochs=3, batch_size=32, learning_rate=2e-05)
```

###### Flexibility
Dataclasses don't require Java-style repetitive constructors. To modify your hyperparameter combination, simply instantiate it as follows.

```python
Hyperparams(epochs=search([1,2,3]))

#       Search 3 dimensions, total 12 combinations
#       epochs: 	    [1, 2, 3]
# 	    batch_size: 	[16, 32]
# 	    learning_rate: 	[1e-05, 2e-05]
```

#### Installation
A single file for now. Just copy it over. 


