{"id":13633382,"url":"https://github.com/gdikov/hypertunity","last_synced_at":"2025-04-18T10:34:46.898Z","repository":{"id":62569980,"uuid":"189841506","full_name":"gdikov/hypertunity","owner":"gdikov","description":"A toolset for black-box hyperparameter optimisation.","archived":false,"fork":false,"pushed_at":"2020-01-26T23:14:49.000Z","size":1455,"stargazers_count":136,"open_issues_count":0,"forks_count":10,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-01T09:49:20.449Z","etag":null,"topics":["bayesian-optimization","gpyopt","hyperparameter-optimization","slurm","tensorboard"],"latest_commit_sha":null,"homepage":"https://hypertunity.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gdikov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-02T12:04:55.000Z","updated_at":"2024-02-27T06:12:04.000Z","dependencies_parsed_at":"2022-11-03T17:15:35.010Z","dependency_job_id":null,"html_url":"https://github.com/gdikov/hypertunity","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdikov%2Fhypertunity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdikov%2Fhypertunity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdikov%2Fhypertunity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdikov%2Fhypertunity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gdikov","download_url":"https://codeload.github.com/gdikov/hypertunity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223779717,"owners_count":17201220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian-optimization","gpyopt","hyperparameter-optimization","slurm","tensorboard"],"created_at":"2024-08-01T23:00:36.079Z","updated_at":"2024-11-09T02:32:02.211Z","avatar_url":"https://github.com/gdikov.png","language":"Python","funding_links":[],"categories":["AutoML","Profiling","Scheduling","Tools and projects","超参数优化和AutoML","Libraries"],"sub_categories":["Profiling","LLM"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/gdikov/hypertunity/master/docs/_static/images/logo.svg?sanitize=true\" width=\"100%\"\u003e\n\u003c/div\u003e\n\n[![CircleCI](https://img.shields.io/circleci/build/github/gdikov/hypertunity)](https://circleci.com/gh/gdikov/hypertunity)\n[![Documentation Status](https://readthedocs.org/projects/hypertunity/badge/?version=latest)](https://hypertunity.readthedocs.io/en/latest/?badge=latest)\n![GitHub](https://img.shields.io/github/license/gdikov/hypertunity)\n\n## Why Hypertunity\n\nHypertunity is a lightweight, high-level library for hyperparameter optimisation. \nAmong others, it supports:\n * Bayesian optimisation by wrapping [GPyOpt](http://sheffieldml.github.io/GPyOpt/),\n * external or internal objective function evaluation by a scheduler, also compatible with [Slurm](https://slurm.schedmd.com),\n * real-time visualisation of results in [Tensorboard](https://www.tensorflow.org/tensorboard) \n via the [HParams](https://www.tensorflow.org/tensorboard/r2/hyperparameter_tuning_with_hparams) plugin.\n\nFor the full set of features refer to the [documentation](https://hypertunity.readthedocs.io).\n\n## Quick start\n\nDefine the objective function to optimise. For example, it can take the hyperparameters `params` as input and \nreturn a raw value `score` as output:\n\n```python\nimport hypertunity as ht\n\ndef foo(**params) -\u003e float:\n    # do some very costly computations\n    ...\n    return score\n```\n\nTo define the valid ranges for the values of `params` we create a `Domain` object:\n\n```python\ndomain = ht.Domain({\n    \"x\": [-10., 10.],         # continuous variable within the interval [-10., 10.]\n    \"y\": {\"opt1\", \"opt2\"},    # categorical variable from the set {\"opt1\", \"opt2\"}\n    \"z\": set(range(4))        # discrete variable from the set {0, 1, 2, 3}\n})\n```\n\nThen we set up the optimiser:\n\n```python\nbo = ht.BayesianOptimisation(domain=domain)\n```\n\nAnd we run the optimisation for 10 steps. Each result is used to update the optimiser so that informed domain \nsamples are drawn:\n\n```python\nn_steps = 10\nfor i in range(n_steps):\n    samples = bo.run_step(batch_size=2, minimise=True)      # suggest next samples\n    evaluations = [foo(**s.as_dict()) for s in samples]     # evaluate foo\n    bo.update(samples, evaluations)                         # update the optimiser\n```\n\nFinally, we visualise the results in Tensorboard: \n\n```python\nimport hypertunity.reports.tensorboard as tb\n\nresults = tb.Tensorboard(domain=domain, metrics=[\"score\"], logdir=\"path/to/logdir\")\nresults.from_history(bo.history)\n```\n\n## Even quicker start\n\nA high-level wrapper class `Trial` allows for seamless parallel optimisation\nwithout bothering with scheduling jobs, updating optimisers and logging:\n   \n```python\ntrial = ht.Trial(objective=foo,\n                 domain=domain,\n                 optimiser=\"bo\",\n                 reporter=\"tensorboard\",\n                 metrics=[\"score\"])\ntrial.run(n_steps, batch_size=2, n_parallel=2)\n```\n\n## Installation\n\n### Using PyPI\nTo install the base version run:\n```bash\npip install hypertunity\n```\nTo use the Tensorboard dashboard, build the docs or run the test suite you will need the following extras:\n```bash\npip install hypertunity[tensorboard,docs,tests]\n```\n\n### From source\nCheckout the latest master and install locally:\n```bash\ngit clone https://github.com/gdikov/hypertunity.git\ncd hypertunity\npip install ./[tensorboard]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgdikov%2Fhypertunity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgdikov%2Fhypertunity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgdikov%2Fhypertunity/lists"}