{"id":13870055,"url":"https://github.com/deephyper/deephyper","last_synced_at":"2025-04-07T02:14:51.711Z","repository":{"id":37561634,"uuid":"156403341","full_name":"deephyper/deephyper","owner":"deephyper","description":"DeepHyper: Scalable Asynchronous Neural Architecture and Hyperparameter Search for Deep Neural Networks","archived":false,"fork":false,"pushed_at":"2024-10-02T07:37:01.000Z","size":44823,"stargazers_count":274,"open_issues_count":20,"forks_count":60,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-10-09T12:32:45.336Z","etag":null,"topics":["automl","deep-learning","hpc","hyperparameter-optimization","keras","machine-learning","mpi","multi-fidelity","neural-architecture-search","python","pytorch","raylib","scalability","tensorflow","uncertainty-quantification"],"latest_commit_sha":null,"homepage":"https://deephyper.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deephyper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-06T15:18:42.000Z","updated_at":"2024-10-07T16:17:23.000Z","dependencies_parsed_at":"2023-11-30T09:33:23.425Z","dependency_job_id":"49ab1b1c-03d9-4122-be2c-90eab6b6acdf","html_url":"https://github.com/deephyper/deephyper","commit_stats":{"total_commits":2520,"total_committers":36,"mean_commits":70.0,"dds":"0.19801587301587298","last_synced_commit":"2cc0b3acf4f27b2eca5e6da4a1feeb4df72fe5de"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deephyper%2Fdeephyper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deephyper%2Fdeephyper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deephyper%2Fdeephyper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deephyper%2Fdeephyper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deephyper","download_url":"https://codeload.github.com/deephyper/deephyper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247578556,"owners_count":20961271,"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":["automl","deep-learning","hpc","hyperparameter-optimization","keras","machine-learning","mpi","multi-fidelity","neural-architecture-search","python","pytorch","raylib","scalability","tensorflow","uncertainty-quantification"],"created_at":"2024-08-05T20:01:27.006Z","updated_at":"2025-04-07T02:14:51.666Z","avatar_url":"https://github.com/deephyper.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/_static/logo/medium.png\"\u003e\n\u003c/p\u003e\n\n[![DOI](https://zenodo.org/badge/156403341.svg)](https://zenodo.org/badge/latestdoi/156403341)\n![GitHub tag (latest by date)](https://img.shields.io/github/tag-date/deephyper/deephyper.svg?label=version)\n[![Documentation Status](https://readthedocs.org/projects/deephyper/badge/?version=latest)](https://deephyper.readthedocs.io/en/latest/?badge=latest)\n![License](https://img.shields.io/github/license/deephyper/deephyper)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/deephyper.svg?label=Pypi%20downloads)\n\n## What is DeepHyper?\n\nDeepHyper is a powerful Python package for automating machine learning tasks, particularly focused on optimizing hyperparameters, searching for optimal neural architectures, and quantifying uncertainty through the use of deep ensembles. With DeepHyper, users can easily perform these tasks on a single machine or distributed across multiple machines, making it ideal for use in a variety of environments. Whether you're a beginner looking to optimize your machine learning models or an experienced data scientist looking to streamline your workflow, DeepHyper has something to offer. So why wait? Start using DeepHyper today and take your machine-learning skills to the next level!\n\n## Installation\n\nInstallation with `pip`:\n\n```console\npip install deephyper\n```\n\nMore details about the installation process can be found in our [Installation](https://deephyper.readthedocs.io/en/stable/install/) documentation.\n\n## Quickstart\n\nThe black-box function named `run` is defined by taking an input job named `job` which contains the different variables to optimize `job.parameters`. Then the run-function is bound to an `Evaluator` in charge of distributing the computation of multiple evaluations. Finally, a Bayesian search named `CBO` is created and executed to find the values of config which **MAXIMIZE** the return value of `run(job)`.\n\n```python\ndef run(job):\n    # The suggested parameters are accessible in job.parameters (dict)\n    x = job.parameters[\"x\"]\n    b = job.parameters[\"b\"]\n\n    if job.parameters[\"function\"] == \"linear\":\n        y = x + b\n    elif job.parameters[\"function\"] == \"cubic\":\n        y = x**3 + b\n\n    # Maximization!\n    return y\n\n\n# Necessary IF statement otherwise it will enter in a infinite recursion\n# when loading the 'run' function from a child processes\nif __name__ == \"__main__\":\n    from deephyper.hpo import CBO, HpProblem\n    from deephyper.evaluator import Evaluator\n\n    # define the variable you want to optimize\n    problem = HpProblem()\n    problem.add_hyperparameter((-10.0, 10.0), \"x\") # real parameter\n    problem.add_hyperparameter((0, 10), \"b\") # discrete parameter\n    problem.add_hyperparameter([\"linear\", \"cubic\"], \"function\") # categorical parameter\n\n    # define the evaluator to distribute the computation\n    evaluator = Evaluator.create(\n        run,\n        method=\"process\",\n        method_kwargs={\n            \"num_workers\": 2,\n        },\n    )\n\n    # define your search and execute it\n    search = CBO(problem, evaluator, random_state=42)\n\n    results = search.search(max_evals=100)\n    print(results)\n```\n\nWhich outputs the following results where the best parameters are with `function == \"cubic\"`, \n`x == 9.99` and `b == 10`.\n\n```verbatim\n     p:b p:function       p:x    objective  job_id job_status  m:timestamp_submit  m:timestamp_gather\n0      7      cubic -1.103350     5.656803       0       DONE            0.018402            1.548068\n1      3      cubic  8.374450   590.312101       1       DONE            0.018485            1.548254\n2      9     linear  8.787395    17.787395       3       DONE            1.564276            1.565336\n3      6      cubic  4.680560   108.540056       2       DONE            1.564209            1.565440\n4      2      cubic  4.012429    66.598442       5       DONE            1.575218            1.576076\n..   ...        ...       ...          ...     ...        ...                 ...                 ...\n96    10      cubic  9.986875  1006.067558      96       DONE            9.895560            9.995656\n97     9      cubic  9.999787  1008.936159      97       DONE            9.995220           10.095534\n98     9      cubic  9.997146  1008.143990      98       DONE           10.095102           10.195398\n99     7      cubic  9.999389  1006.816600      99       DONE           10.194956           10.297452\n100    9      cubic  9.997912  1008.373594     100       DONE           10.296981           10.412184\n```\n\nThe code defines a function `run` that takes a RunningJob `job` as input and returns the maximized objective `y`. The `if` block at the end of the code defines a black-box optimization process using the `CBO` (Centralized Bayesian Optimization) algorithm from the `deephyper` library.\n\nThe optimization process is defined as follows:\n\n1. A hyperparameter optimization problem is created using the `HpProblem` class from `deephyper`. In this case, the problem has three variables. The `x` hyperparameter is a real variable in a range from -10.0 to 10.0. The `b` hyperparameter is a discrete variable in a range from 0 to 10. The `function` hyperparameter is a categorical variable with two possible values.\n2. An evaluator is created using the `Evaluator.create` method. The evaluator will be used to evaluate the function `run` with different configurations of suggested hyperparameters in the optimization problem. The evaluator uses the `process` method to distribute the evaluations across multiple worker processes, in this case, 2 worker processes.\n3. A search object is created using the `CBO` class, the problem and evaluator defined earlier. The `CBO` algorithm is a derivative-free optimization method that uses a Bayesian optimization approach to explore the hyperparameter space.\n4. The optimization process is executed by calling the `search.search` method, which performs the evaluations of the `run` function with different configurations of the hyperparameters until a maximum number of evaluations (100 in this case) is reached.\n5. The results of the optimization process, including the optimal configuration of the hyperparameters and the corresponding objective value, are printed to the console.\n\n## How do I learn more?\n\nCheck out our online documentation with API reference and examples: \u003chttps://deephyper.readthedocs.io\u003e\n\n## Citing DeepHyper\n\nIf you wish to cite the Software, please use the following:\n\n```\n@misc{deephyper_software,\n    title = {\"DeepHyper: A Python Package for Scalable Neural Architecture and Hyperparameter Search\"},\n    author = {Balaprakash, Prasanna and Egele, Romain and Salim, Misha and Maulik, Romit and Vishwanath, Venkat and Wild, Stefan and others},\n    organization = {DeepHyper Team},\n    year = 2018,\n    url = {https://github.com/deephyper/deephyper}\n} \n```\n\n## How can I participate?\n\nQuestions, comments, feature requests, bug reports, etc. can be directed to Github Issues.\n\nPatches through pull requests are much appreciated on the software itself as well as documentation.\n\nMore documentation about how to contribute is available on [deephyper.readthedocs.io/en/latest/developer_guides/contributing.html](https://deephyper.readthedocs.io/en/latest/developer_guides/contributing.html).\n\n## Acknowledgments\n\n* Scalable Data-Efficient Learning for Scientific Domains, U.S. Department of Energy 2018 Early Career Award funded by the Advanced Scientific Computing Research program within the DOE Office of Science (2018--Present)\n* Argonne Leadership Computing Facility: This research used resources of the Argonne Leadership Computing Facility, which is a DOE Office of Science User Facility supported under Contract DE-AC02-06CH11357.\n* SLIK-D: Scalable Machine Learning Infrastructures for Knowledge Discovery, Argonne Computing, Environment and Life Sciences (CELS) Laboratory Directed Research and Development (LDRD) Program (2016--2018)\n\n## Copyright and license\n\nCopyright © 2019, UChicago Argonne, LLC\n\nDeepHyper is distributed under the terms of BSD License. See [LICENSE](https://github.com/deephyper/deephyper/blob/master/LICENSE)\n\nArgonne Patent \u0026 Intellectual Property File Number: SF-19-007\n","funding_links":[],"categories":["Python","Libraries"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeephyper%2Fdeephyper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeephyper%2Fdeephyper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeephyper%2Fdeephyper/lists"}