{"id":13906241,"url":"https://github.com/sherpa-ai/sherpa","last_synced_at":"2025-04-04T14:10:00.397Z","repository":{"id":50671592,"uuid":"133726057","full_name":"sherpa-ai/sherpa","owner":"sherpa-ai","description":"Hyperparameter optimization that enables researchers to experiment, visualize, and scale quickly.","archived":false,"fork":false,"pushed_at":"2020-10-18T07:57:50.000Z","size":5844,"stargazers_count":337,"open_issues_count":19,"forks_count":54,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-28T13:07:47.337Z","etag":null,"topics":["bayesian-optimization","deep-learning","hyperparameter-grid","hyperparameter-optimization","hyperparameter-search","hyperparameter-tuning","keras","machine-learning","machine-learning-library"],"latest_commit_sha":null,"homepage":"http://parameter-sherpa.readthedocs.io/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sherpa-ai.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"docs/contributing/contributing.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-16T21:41:54.000Z","updated_at":"2025-03-24T10:46:24.000Z","dependencies_parsed_at":"2022-09-10T04:05:06.948Z","dependency_job_id":null,"html_url":"https://github.com/sherpa-ai/sherpa","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherpa-ai%2Fsherpa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherpa-ai%2Fsherpa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherpa-ai%2Fsherpa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherpa-ai%2Fsherpa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sherpa-ai","download_url":"https://codeload.github.com/sherpa-ai/sherpa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247190255,"owners_count":20898702,"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","deep-learning","hyperparameter-grid","hyperparameter-optimization","hyperparameter-search","hyperparameter-tuning","keras","machine-learning","machine-learning-library"],"created_at":"2024-08-06T23:01:31.850Z","updated_at":"2025-04-04T14:10:00.373Z","avatar_url":"https://github.com/sherpa-ai.png","language":"JavaScript","funding_links":[],"categories":["超参数优化和AutoML"],"sub_categories":[],"readme":"SHERPA: A Python Hyperparameter Optimization Library\n====================================================\n\n.. figure:: https://docs.google.com/drawings/d/e/2PACX-1vRaTP5d5WqT4KY4V57niI4wFDkz0098zHTRzZ9n7SzzFtdN5akBd75HchBnhYI-GPv_AYH1zYa0O2_0/pub?w=522\u0026h=150\n    :figwidth: 100%\n    :align: right\n    :height: 150px\n    :alt: SHERPA logo\n\n\n.. image:: https://img.shields.io/badge/License-GPL%20v3-blue.svg\n   :target: https://www.gnu.org/licenses/gpl-3.0\n   \n    \n.. image:: https://travis-ci.org/sherpa-ai/sherpa.svg?branch=master\n    :target: https://travis-ci.org/sherpa-ai/sherpa.svg?branch=master\n    :alt: Build Status\n    \n\n.. image:: https://pepy.tech/badge/parameter-sherpa\n   :target: https://pepy.tech/project/parameter-sherpa\n\n\nSHERPA is a Python library for hyperparameter tuning of machine learning models. It provides:\n\n* hyperparameter optimization for machine learning researchers\n* it can be used with any Python machine learning library such as Keras, Tensorflow, PyTorch, or Scikit-Learn\n* a choice of hyperparameter optimization algorithms such as **Bayesian optimization via GPyOpt** (`example notebook \u003chttps://github.com/sherpa-ai/sherpa/tree/master/examples/keras_mnist_mlp.ipynb\u003e`_), **Asynchronous Successive Halving** (aka Hyperband) (`example notebook \u003chttps://github.com/sherpa-ai/sherpa/tree/master/examples/keras_mnist_mlp_successive_halving.ipynb\u003e`_), and **Population Based Training** (`example notebook \u003chttps://github.com/sherpa-ai/sherpa/tree/master/examples/keras_mnist_mlp_population_based_training.ipynb\u003e`_).\n* **parallel** computation that can be fitted to the user's needs\n* a live **dashboard** for the exploratory analysis of results.\n\nClone from GitHub to get the latest version or install via ``pip install parameter-sherpa``. The documentation at http://parameter-sherpa.readthedocs.io/ provides tutorials on using the different optimization algorithms and installation instructions for parallel hyperparameter\noptimizations. Take a look at the demo\nvideo by clicking on the image below or read on to find out more.\n\n*We would love to hear what you think of Sherpa! Tell us how we can improve via our* Feedback-Form_.\n\n.. _Feedback-Form: https://forms.gle/b3HoyJZHjQnYtv677\n\n\n.. image:: http://img.youtube.com/vi/-exnF3uv0Ws/0.jpg\n   :target: https://www.youtube.com/watch?feature=player_embedded\u0026v=-exnF3uv0Ws\n\n\nIf you use SHERPA in your research please cite:\n\n::\n\n    @article{hertel2020sherpa,\n       title={Sherpa: Robust Hyperparameter Optimization for Machine Learning},\n       author={Lars Hertel and Julian Collado and Peter Sadowski and Jordan Ott and Pierre Baldi},\n       journal={SoftwareX},\n       volume={},\n       number={},\n       pages={},\n       note={In press.}\n       year={2020},\n       note  ={Also arXiv:2005.04048. Software available at: https://github.com/sherpa-ai/sherpa},\n       publisher={}\n    }\n\nFrom Keras to Sherpa in 30 seconds\n==================================\n\nThis example will show how to adapt a minimal Keras script so it can\nbe used with SHERPA. As starting point we use the \"getting started in 30 seconds\"\ntutorial from the Keras webpage.\n\nWe start out with this piece of Keras code:\n\n::\n\n    from keras.models import Sequential\n    from keras.layers import Dense\n    model = Sequential()\n    model.add(Dense(units=64, activation='relu', input_dim=100))\n    model.add(Dense(units=10, activation='softmax'))\n    model.compile(loss='categorical_crossentropy',\n              optimizer='sgd',\n              metrics=['accuracy'])\n\nWe want to tune the number of hidden units via Random Search. To do that, we\ndefine one parameter of type `Discrete`.\nWe also use the `BayesianOptimization` algorithm with maximum number of trials 50.\n\n::\n\n    import sherpa\n    parameters = [sherpa.Discrete('num_units', [50, 200])]\n    alg = sherpa.algorithms.BayesianOptimization(max_num_trials=50)\n\nWe use these objects to create a SHERPA Study:\n\n::\n\n    study = sherpa.Study(parameters=parameters,\n                         algorithm=alg,\n                         lower_is_better=True)\n\nWe obtain `trials` by iterating over the study. Each `trial` has a `parameter`\nattribute that contains the ``num_units`` parameter value. We can use that value\nto create our model.\n\n::\n\n    for trial in study:\n        model = Sequential()\n        model.add(Dense(units=trial.parameters['num_units'],\n                        activation='relu', input_dim=100))\n        model.add(Dense(units=10, activation='softmax'))\n        model.compile(loss='categorical_crossentropy',\n                  optimizer='sgd',\n                  metrics=['accuracy'])\n\n        model.fit(x_train, y_train, epochs=5, batch_size=32,\n                  callbacks=[study.keras_callback(trial, objective_name='val_loss')])\n        study.finalize(trial)\n\nDuring training, objective values will be added to the SHERPA study via the\ncallback. At the end of training ``study.finalize`` completes this trial. This means\nthat no more observation will be added to this trial.\n\nWhen the ``Study`` is created, SHERPA will display the dashboard address. If you\nput the address into your browser you will see the dashboard as shown below. As a next step you\ncan take a look at this example of optimizing a Random Forest in\n``sherpa/examples/randomforest.py``.\n\n.. figure:: https://drive.google.com/uc?export=view\u0026id=1G85sfwLicsQKd3-1xN7DZowQ0gHAvzGx\n   :alt: SHERPA Dashboard.\n   \n\nInstallation from PyPi\n======================\n\n::\n\n    pip install parameter-sherpa\n\n\nInstallation from GitHub\n========================\n\nClone from GitHub:\n\n::\n\n    git clone https://github.com/LarsHH/sherpa.git\n    export PYTHONPATH=$PYTHONPATH:`pwd`/sherpa\n\nInstall dependencies:\n\n::\n\n    pip install pandas\n    pip install numpy\n    pip install scipy\n    pip install scikit-learn\n    pip install flask\n    pip install enum34  # if on \u003c Python 3.4\n\nYou can run an example to verify SHERPA is working:\n\n::\n\n    cd sherpa/examples/\n    python simple.py\n\nNote that to run hyperparameter optimizations in parallel with SHERPA requires\nthe installation of Mongo DB. Further instructions can be found in the\nParallel Installation section of the documentation.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsherpa-ai%2Fsherpa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsherpa-ai%2Fsherpa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsherpa-ai%2Fsherpa/lists"}