siste-test


Namesiste-test JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryHyperFetch. A tool to optimize and fetch hyperparameters for your reinforcement learning application.
upload_time2023-04-16 22:58:40
maintainer
docs_urlNone
author
requires_python>=3.9
licenseCopyright 2023 Karoline Sund Wahl Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords reinforcement learning hyperparameters replication
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # HyperFetch
#### HyperFetch is a tool consisting of:
- [Website](https://github.com/karolisw/hyperFetch) for fetching hyperparameters that are tuned by others
- Pip-module for tuning hyperparameters 

#### The intention of HyperFetch is to:
- Make recreation of existing projects easier within the 
  reinforcement learning research community.
- Allow beginners to train and implement their own reinforcement 
  learning models easier due to abstracting away the advanced tuning-step.

#### The tool is expected to aid in decreasing CO2-emissions related to tuning hyperparameters when training RL models. 
This is expected to be done by posting tuned algorithm x environment combinations to the websitesuch that:
- Developers/Students can access hyperparameters that have been optimially tuned before instead of having to tune them themselves.
- Researchers can filter by project on the website and access hyperparameters they wish to recreate/replicate for their own research.

The persistance endpoints opens up to the user through this package.
To access/fetch hyperparameters optimized by other RL-practicioners, 
have a look at the HyperFetch website.

## Content
* [Links](#links)</font>
* 1.0 [Using the pip module](#using-the-pip-module)</font>
   * 1.1 [Examples](#example-1--tuning--posting-using-hyperfetch)</font>
* 2.0  [Using the Website](#getting-the-website-up-and-running)</font>
   * 2.1 [Installation backend](#installation-backend)</font>
   * 2.2 [Setup backend](#start-up-backend)</font>
   * 2.3 [Setup frontend](#start-up-frontend)</font>
   * 2.4 [Installation frontend](#installation-frontend)</font>

## Links
Repository: [HyperFetch Github](https://github.com/karolisw/hyperFetch)\
Documentation: [HyperFetch Website](https://github.com/karolisw/hyperFetch/tree/frontend)

## Using the pip module
To use the pip model please do the following:
1. Create a virtual environment in your favorite IDE. The virtual environment must be of the type virtualenv.

Install virtualenv if you haven't 

        pip install virtualenv

Create a virtual environment

        virtualenv [some_name]

Activate virtualenv this way if using windows:

       # In cmd.exe
       venv\Scripts\activate.bat
       # In PowerShell
       venv\Scripts\Activate.ps1

Activate virtualenv this way if using Linux/MacOS:

        $ source myvenv/bin/activate

2. Install the pip-module!
   
         
## Example 1: tuning + posting using HyperFetch
Here is a quick example of how to tune and run PPO in the LunarLander-v2 environment inside your new or existing project:

### Just a reminder:
The pip package must be installed before this can be done.
To install the pip-package, the steps to get the [front](#start-up-frontend) -or [backend](#start-up-backend) 
started/running do not need to be done.\
For details, see [using the pip module](#using-the-pip-module).

### 1. Create configuartion  YAML file (minimal example)

```yaml
# Required (example values)
alg: ppo
env: LunarLander-v2
project_name: some_project
git_link: github.com/user/some_project

# Some other useful parameters
sampler: tpe
tuner: median
n_trials: 20
log_folder: logs
```

### 2. Tune using python file or command line

```python

from hyperfetch import tuning

# Path to your YAML config file 
config_path = "../some_folder/config_name.yml"

# Writes each trial's best hyperparameters to log folder
tuning.tune(config_path)
```

#### Command line:
If in the same directory as the config file and the config file is called "config.yml"

      tune_cli config.yml

#### Enjoy your hyperparameters!

## Example 2: Posting hyperparameters that are not tuned by Hyperfetch

### Just a reminder:
The pip package must be installed before this can be done.
To install the pip-package, the steps to get the [front](#start-up-frontend) -or [backend](#start-up-backend) 
started/running do not need to be done.\
For details, see [using the pip module](#using-the-pip-module).

### 1. Create configuartion  YAML file 

```yaml
# Required (example values)
alg: dqn
env: LunarLander-v2
project_name: some_project
git_link: github.com/user/some_project
hyperparameters: # These depend on the choice of algorithm
  batch_size: 256
  buffer_size: 50000
  exploration_final_eps: 0.10717928118310233
  exploration_fraction: 0.3318973226098944
  gamma: 0.9
  learning_rate: 0.0002126832542803243
  learning_starts: 10000
  net_arch: medium
  subsample_steps: 4
  target_update_interval: 1000
  train_freq: 8
  
# Not required (but appreciated)
CO2_emissions: 0.78 #kgs
energy_consumed: 3.27 #kWh
cpu_model: 12th Gen Intel(R) Core(TM) i5-12500H
gpu_model: NVIDIA GeForce RTX 3070
total_time: 0:04:16.842800 # H:M:S:MS
```

### 2. Save/post using python file or command line

#### Python file:
```python

from hyperfetch import tuning

# Path to your YAML config file 
config_path = "../some_folder/config_name.yml"

# Writes each trial's best hyperparameters to log folder
tuning.save(config_path)
```

#### Command line:
If in the same directory as the config file and the config file is called "config.yml"

      save_cli config.yml




## Getting the website up and running
### Installation backend
Make sure you have 
- Pip version 23.0.1 or higher
- Python 3.10
- virtualenv (not venv)
Clone this repository by either:
1. Open git bash 
2. Change the current working directory to the location where you want the cloned directory.
3. Paste this snip:

        git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY

4. Install virtualenv if you haven't 

        pip install virtualenv

5. Create a virtual environment

        virtualenv [some_name]

    Activate virtualenv this way if using windows:

       # In cmd.exe
       venv\Scripts\activate.bat
       # In PowerShell
       venv\Scripts\Activate.ps1

    Activate virtualenv this way if using Linux/MacOS:

        $ source myvenv/bin/activate

6. Press Enter to create your local clone.

        Cloning into 'hyperFetch'...
        remote: Enumerating objects: 466, done.
        remote: Counting objects: 100% (466/466), done.
        remote: Compressing objects: 100% (238/238), done.
        remote: Total 466 (delta 221), reused 438 (delta 200), pack-reused 0
        Receiving objects: 100% (466/466), 4.17 MiB | 10.29 MiB/s, done.
        Resolving deltas: 100% (221/221), done.

7. You may now change directory by writing into the terminal:
        
        cd hyperfetch

8. Then, install the dependencies into your virtual environment

         pip install -r requirements.txt


### Start up backend
After cloning and installing, you can finally start up the server!

          uvicorn main:app --reload   
        

### Installation frontend
The frontend-branch is inside of the same project. However, 
because the frontend-branch (frontend) and backend-branch (master)
must run at the same time to serve the website, 
the project must be cloned twice into two different local respositories. 

1. Follow stages 3-6 in [installation backend](#installation-backend) 
   This includes:
   - Move into another working directory
   - Clone the project
   - Create a new virtualenv
   - Activate the virtualenv

3. The frontend-branch does not exist locally and must be fetched remotely. 
   In the terminal, type: 

       git switch frontend

4. Enter the correct folder
       
       cd src
5. Install dependencies. This will creat a node_modules folder in your local repository.

       npm install

### Start up frontend

1. To serve the website (dev mode), run:

       npm run dev

2. Click the link that appears in the terminal, or access your browser of choice and type in:

       http://localhost:5173/

3. Good luck!

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "siste-test",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "reinforcement learning,hyperparameters,replication",
    "author": "",
    "author_email": "Karoline Sund Wahl <karolies.wahl@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/6b/d6/bc0ec64787d6e44678029b70859babd71b246c1cde58be117f1cc7ede8ad/siste_test-0.1.0.tar.gz",
    "platform": null,
    "description": "# HyperFetch\r\n#### HyperFetch is a tool consisting of:\r\n- [Website](https://github.com/karolisw/hyperFetch) for fetching hyperparameters that are tuned by others\r\n- Pip-module for tuning hyperparameters \r\n\r\n#### The intention of HyperFetch is to:\r\n- Make recreation of existing projects easier within the \r\n  reinforcement learning research community.\r\n- Allow beginners to train and implement their own reinforcement \r\n  learning models easier due to abstracting away the advanced tuning-step.\r\n\r\n#### The tool is expected to aid in decreasing CO2-emissions related to tuning hyperparameters when training RL models. \r\nThis is expected to be done by posting tuned algorithm x environment combinations to the websitesuch that:\r\n- Developers/Students can access hyperparameters that have been optimially tuned before instead of having to tune them themselves.\r\n- Researchers can filter by project on the website and access hyperparameters they wish to recreate/replicate for their own research.\r\n\r\nThe persistance endpoints opens up to the user through this package.\r\nTo access/fetch hyperparameters optimized by other RL-practicioners, \r\nhave a look at the HyperFetch website.\r\n\r\n## Content\r\n* [Links](#links)</font>\r\n* 1.0 [Using the pip module](#using-the-pip-module)</font>\r\n   * 1.1 [Examples](#example-1--tuning--posting-using-hyperfetch)</font>\r\n* 2.0  [Using the Website](#getting-the-website-up-and-running)</font>\r\n   * 2.1 [Installation backend](#installation-backend)</font>\r\n   * 2.2 [Setup backend](#start-up-backend)</font>\r\n   * 2.3 [Setup frontend](#start-up-frontend)</font>\r\n   * 2.4 [Installation frontend](#installation-frontend)</font>\r\n\r\n## Links\r\nRepository: [HyperFetch Github](https://github.com/karolisw/hyperFetch)\\\r\nDocumentation: [HyperFetch Website](https://github.com/karolisw/hyperFetch/tree/frontend)\r\n\r\n## Using the pip module\r\nTo use the pip model please do the following:\r\n1. Create a virtual environment in your favorite IDE. The virtual environment must be of the type virtualenv.\r\n\r\nInstall virtualenv if you haven't \r\n\r\n        pip install virtualenv\r\n\r\nCreate a virtual environment\r\n\r\n        virtualenv [some_name]\r\n\r\nActivate virtualenv this way if using windows:\r\n\r\n       # In cmd.exe\r\n       venv\\Scripts\\activate.bat\r\n       # In PowerShell\r\n       venv\\Scripts\\Activate.ps1\r\n\r\nActivate virtualenv this way if using Linux/MacOS:\r\n\r\n        $ source myvenv/bin/activate\r\n\r\n2. Install the pip-module!\r\n   \r\n         \r\n## Example 1: tuning + posting using HyperFetch\r\nHere is a quick example of how to tune and run PPO in the LunarLander-v2 environment inside your new or existing project:\r\n\r\n### Just a reminder:\r\nThe pip package must be installed before this can be done.\r\nTo install the pip-package, the steps to get the [front](#start-up-frontend) -or [backend](#start-up-backend) \r\nstarted/running do not need to be done.\\\r\nFor details, see [using the pip module](#using-the-pip-module).\r\n\r\n### 1. Create configuartion  YAML file (minimal example)\r\n\r\n```yaml\r\n# Required (example values)\r\nalg: ppo\r\nenv: LunarLander-v2\r\nproject_name: some_project\r\ngit_link: github.com/user/some_project\r\n\r\n# Some other useful parameters\r\nsampler: tpe\r\ntuner: median\r\nn_trials: 20\r\nlog_folder: logs\r\n```\r\n\r\n### 2. Tune using python file or command line\r\n\r\n```python\r\n\r\nfrom hyperfetch import tuning\r\n\r\n# Path to your YAML config file \r\nconfig_path = \"../some_folder/config_name.yml\"\r\n\r\n# Writes each trial's best hyperparameters to log folder\r\ntuning.tune(config_path)\r\n```\r\n\r\n#### Command line:\r\nIf in the same directory as the config file and the config file is called \"config.yml\"\r\n\r\n      tune_cli config.yml\r\n\r\n#### Enjoy your hyperparameters!\r\n\r\n## Example 2: Posting hyperparameters that are not tuned by Hyperfetch\r\n\r\n### Just a reminder:\r\nThe pip package must be installed before this can be done.\r\nTo install the pip-package, the steps to get the [front](#start-up-frontend) -or [backend](#start-up-backend) \r\nstarted/running do not need to be done.\\\r\nFor details, see [using the pip module](#using-the-pip-module).\r\n\r\n### 1. Create configuartion  YAML file \r\n\r\n```yaml\r\n# Required (example values)\r\nalg: dqn\r\nenv: LunarLander-v2\r\nproject_name: some_project\r\ngit_link: github.com/user/some_project\r\nhyperparameters: # These depend on the choice of algorithm\r\n  batch_size: 256\r\n  buffer_size: 50000\r\n  exploration_final_eps: 0.10717928118310233\r\n  exploration_fraction: 0.3318973226098944\r\n  gamma: 0.9\r\n  learning_rate: 0.0002126832542803243\r\n  learning_starts: 10000\r\n  net_arch: medium\r\n  subsample_steps: 4\r\n  target_update_interval: 1000\r\n  train_freq: 8\r\n  \r\n# Not required (but appreciated)\r\nCO2_emissions: 0.78 #kgs\r\nenergy_consumed: 3.27 #kWh\r\ncpu_model: 12th Gen Intel(R) Core(TM) i5-12500H\r\ngpu_model: NVIDIA GeForce RTX 3070\r\ntotal_time: 0:04:16.842800 # H:M:S:MS\r\n```\r\n\r\n### 2. Save/post using python file or command line\r\n\r\n#### Python file:\r\n```python\r\n\r\nfrom hyperfetch import tuning\r\n\r\n# Path to your YAML config file \r\nconfig_path = \"../some_folder/config_name.yml\"\r\n\r\n# Writes each trial's best hyperparameters to log folder\r\ntuning.save(config_path)\r\n```\r\n\r\n#### Command line:\r\nIf in the same directory as the config file and the config file is called \"config.yml\"\r\n\r\n      save_cli config.yml\r\n\r\n\r\n\r\n\r\n## Getting the website up and running\r\n### Installation backend\r\nMake sure you have \r\n- Pip version 23.0.1 or higher\r\n- Python 3.10\r\n- virtualenv (not venv)\r\nClone this repository by either:\r\n1. Open git bash \r\n2. Change the current working directory to the location where you want the cloned directory.\r\n3. Paste this snip:\r\n\r\n        git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY\r\n\r\n4. Install virtualenv if you haven't \r\n\r\n        pip install virtualenv\r\n\r\n5. Create a virtual environment\r\n\r\n        virtualenv [some_name]\r\n\r\n    Activate virtualenv this way if using windows:\r\n\r\n       # In cmd.exe\r\n       venv\\Scripts\\activate.bat\r\n       # In PowerShell\r\n       venv\\Scripts\\Activate.ps1\r\n\r\n    Activate virtualenv this way if using Linux/MacOS:\r\n\r\n        $ source myvenv/bin/activate\r\n\r\n6. Press Enter to create your local clone.\r\n\r\n        Cloning into 'hyperFetch'...\r\n        remote: Enumerating objects: 466, done.\r\n        remote: Counting objects: 100% (466/466), done.\r\n        remote: Compressing objects: 100% (238/238), done.\r\n        remote: Total 466 (delta 221), reused 438 (delta 200), pack-reused 0\r\n        Receiving objects: 100% (466/466), 4.17 MiB | 10.29 MiB/s, done.\r\n        Resolving deltas: 100% (221/221), done.\r\n\r\n7. You may now change directory by writing into the terminal:\r\n        \r\n        cd hyperfetch\r\n\r\n8. Then, install the dependencies into your virtual environment\r\n\r\n         pip install -r requirements.txt\r\n\r\n\r\n### Start up backend\r\nAfter cloning and installing, you can finally start up the server!\r\n\r\n          uvicorn main:app --reload   \r\n        \r\n\r\n### Installation frontend\r\nThe frontend-branch is inside of the same project. However, \r\nbecause the frontend-branch (frontend) and backend-branch (master)\r\nmust run at the same time to serve the website, \r\nthe project must be cloned twice into two different local respositories. \r\n\r\n1. Follow stages 3-6 in [installation backend](#installation-backend) \r\n   This includes:\r\n   - Move into another working directory\r\n   - Clone the project\r\n   - Create a new virtualenv\r\n   - Activate the virtualenv\r\n\r\n3. The frontend-branch does not exist locally and must be fetched remotely. \r\n   In the terminal, type: \r\n\r\n       git switch frontend\r\n\r\n4. Enter the correct folder\r\n       \r\n       cd src\r\n5. Install dependencies. This will creat a node_modules folder in your local repository.\r\n\r\n       npm install\r\n\r\n### Start up frontend\r\n\r\n1. To serve the website (dev mode), run:\r\n\r\n       npm run dev\r\n\r\n2. Click the link that appears in the terminal, or access your browser of choice and type in:\r\n\r\n       http://localhost:5173/\r\n\r\n3. Good luck!\r\n",
    "bugtrack_url": null,
    "license": "Copyright 2023 Karoline Sund Wahl  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \u201cAS IS\u201d AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "HyperFetch. A tool to optimize and fetch hyperparameters for your reinforcement learning application.",
    "version": "0.1.0",
    "split_keywords": [
        "reinforcement learning",
        "hyperparameters",
        "replication"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2e664f7dacd38a389abead7c3646d0c46a1f5a28cbf37f905e85d3a3dddc1d82",
                "md5": "01d260e84b4f7e62ae10798d0c12bb92",
                "sha256": "d3d3ee7aa01b9206ed132aed4f941e58e6567697d686310a87fbb799450c9169"
            },
            "downloads": -1,
            "filename": "siste_test-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "01d260e84b4f7e62ae10798d0c12bb92",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 19714,
            "upload_time": "2023-04-16T22:58:37",
            "upload_time_iso_8601": "2023-04-16T22:58:37.772692Z",
            "url": "https://files.pythonhosted.org/packages/2e/66/4f7dacd38a389abead7c3646d0c46a1f5a28cbf37f905e85d3a3dddc1d82/siste_test-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6bd6bc0ec64787d6e44678029b70859babd71b246c1cde58be117f1cc7ede8ad",
                "md5": "98e7c437ac41196858aaa5ff4aaa38af",
                "sha256": "b5a006ad047a000cc09f4adcbcc898641b6b4216d3f8053409da86a1e6d5da21"
            },
            "downloads": -1,
            "filename": "siste_test-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "98e7c437ac41196858aaa5ff4aaa38af",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 22428,
            "upload_time": "2023-04-16T22:58:40",
            "upload_time_iso_8601": "2023-04-16T22:58:40.188066Z",
            "url": "https://files.pythonhosted.org/packages/6b/d6/bc0ec64787d6e44678029b70859babd71b246c1cde58be117f1cc7ede8ad/siste_test-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-16 22:58:40",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "siste-test"
}
        
Elapsed time: 0.07816s