optunacy


Nameoptunacy JSON
Version 0.3.3 PyPI version JSON
download
home_pagehttps://github.com/retospect/optunacy
SummaryOptunacy is a contour plot generator for Optuna studies.
upload_time2024-01-23 16:18:44
maintainerReto Stamm
docs_urlNone
authorReto Stamm
requires_python>=3.9,<4.0
licenseGPL-3
keywords optuna contour plot snn hyperparameter optimization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![workflow status](https://github.com/retospect/optunacy/actions/workflows/check.yml/badge.svg?branch=main)
# Optunacy - alternate Optuna contour plotter

Plots Optuna contour plots trivially and with detailed mouseovers.
It collects data from all the hashes in Optuna, as well as the Objectives if you provide them.

It provides mouseovers with details, too.

## Example

```python
from optunacy.oplot import OPlot
def optuna_objective(trial, train_loader, test_loader):
    ...
    trial.set_user_attr("Neurons per Hidden Layer", nphl)
    ...
    # The objectives have a printable name and direction
    return             validation_accuracy,   spikes_per_digit
objective_names      = ["Validation Accuracy", "Spikes per Digit"]
objective_directions = ["maximize",            "minimize"]

study = optuna.create_study(study_name="Minimize spikes, maximize accuracy",
                            directions=objective_directions)

study.optimize( lambda trial:
                optuna_objective(trial, train_loader, test_loader),
                n_trials=100)

see = OPlot(study, objective_names)
see.plot("Hidden Layers", "Neurons per Hidden Layer", "Validation Accuracy", z_clip=(0.8,1))
```
![Sample output](images/pic1.png)


## Options
The plot function has these options:

``` python
def plot(self, 
         x_name, # string
         y_name, # string
         z_name=None,  # string
         x_range=None, # range, ex: x_range=(3,9)
         y_range=None, # range
         z_clip=None,  # Clamps colors to max and min
         interpol="linear"): # <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.griddata.html">interpolation method</a>
```


## Installation

```pip install optunacy```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/retospect/optunacy",
    "name": "optunacy",
    "maintainer": "Reto Stamm",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "optuna,contour,plot,snn,hyperparameter,optimization",
    "author": "Reto Stamm",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/88/c2/f12eeb22520749b08ab86b98be3600a398bdb64b7cd754715fc47635ce05/optunacy-0.3.3.tar.gz",
    "platform": null,
    "description": "![workflow status](https://github.com/retospect/optunacy/actions/workflows/check.yml/badge.svg?branch=main)\n# Optunacy - alternate Optuna contour plotter\n\nPlots Optuna contour plots trivially and with detailed mouseovers.\nIt collects data from all the hashes in Optuna, as well as the Objectives if you provide them.\n\nIt provides mouseovers with details, too.\n\n## Example\n\n```python\nfrom optunacy.oplot import OPlot\ndef optuna_objective(trial, train_loader, test_loader):\n    ...\n    trial.set_user_attr(\"Neurons per Hidden Layer\", nphl)\n    ...\n    # The objectives have a printable name and direction\n    return             validation_accuracy,   spikes_per_digit\nobjective_names      = [\"Validation Accuracy\", \"Spikes per Digit\"]\nobjective_directions = [\"maximize\",            \"minimize\"]\n\nstudy = optuna.create_study(study_name=\"Minimize spikes, maximize accuracy\",\n                            directions=objective_directions)\n\nstudy.optimize( lambda trial:\n                optuna_objective(trial, train_loader, test_loader),\n                n_trials=100)\n\nsee = OPlot(study, objective_names)\nsee.plot(\"Hidden Layers\", \"Neurons per Hidden Layer\", \"Validation Accuracy\", z_clip=(0.8,1))\n```\n![Sample output](images/pic1.png)\n\n\n## Options\nThe plot function has these options:\n\n``` python\ndef plot(self, \n         x_name, # string\n         y_name, # string\n         z_name=None,  # string\n         x_range=None, # range, ex: x_range=(3,9)\n         y_range=None, # range\n         z_clip=None,  # Clamps colors to max and min\n         interpol=\"linear\"): # <a href=\"https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.griddata.html\">interpolation method</a>\n```\n\n\n## Installation\n\n```pip install optunacy```\n",
    "bugtrack_url": null,
    "license": "GPL-3",
    "summary": "Optunacy is a contour plot generator for Optuna studies.",
    "version": "0.3.3",
    "project_urls": {
        "Homepage": "https://github.com/retospect/optunacy",
        "Repository": "https://github.com/retospect/optunacy"
    },
    "split_keywords": [
        "optuna",
        "contour",
        "plot",
        "snn",
        "hyperparameter",
        "optimization"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b08ba9fcb2d49271ac8040c812d07737772a41519e705a804873026d523884f",
                "md5": "7aac60fa07b8d3b56b7cb84ed782281e",
                "sha256": "246eeecfc5e495fccecc94cb693a0123b7d5bcd98f9f96fc96613a24e2f3e056"
            },
            "downloads": -1,
            "filename": "optunacy-0.3.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7aac60fa07b8d3b56b7cb84ed782281e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 16931,
            "upload_time": "2024-01-23T16:18:43",
            "upload_time_iso_8601": "2024-01-23T16:18:43.210682Z",
            "url": "https://files.pythonhosted.org/packages/6b/08/ba9fcb2d49271ac8040c812d07737772a41519e705a804873026d523884f/optunacy-0.3.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "88c2f12eeb22520749b08ab86b98be3600a398bdb64b7cd754715fc47635ce05",
                "md5": "8284c92cfa9d5e2d8a2f76c505a341ec",
                "sha256": "3a907fd979fb1c73be3cad012e2e6bb7dad21fd312f524fa8b844e0fd250990e"
            },
            "downloads": -1,
            "filename": "optunacy-0.3.3.tar.gz",
            "has_sig": false,
            "md5_digest": "8284c92cfa9d5e2d8a2f76c505a341ec",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 16479,
            "upload_time": "2024-01-23T16:18:44",
            "upload_time_iso_8601": "2024-01-23T16:18:44.937512Z",
            "url": "https://files.pythonhosted.org/packages/88/c2/f12eeb22520749b08ab86b98be3600a398bdb64b7cd754715fc47635ce05/optunacy-0.3.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-23 16:18:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "retospect",
    "github_project": "optunacy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "optunacy"
}
        
Elapsed time: 0.21431s