Package: hyperfetch
HyperFetchPrerequisistesThe package has been successfully tested with Linux and MacOS.However, these are the prerequisites:pip==22.2.2setuptools==64.0.3swig==4.0.2box2d-py==2.3.8NB: If you are able to install box2d-py==2.3.8 on your Windows computer, then the installation will likely succeed
there as well.HyperFetch is a tool consisting of:Awebsitefor fetching hyperparameters that are tuned by othersThis pip-module for tuning and saving hyperparameters yourselfThe 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.By posting tuned [algorithm x environment] combinations to the website it's expected that:Developers/Students can access hyperparameters that have already been optimially tuned 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.Transparancy related to emissions will become more mainstream within the field.Content1.0Using this package2.0Examples of useLinksRepository:HyperFetch GithubDocumentation:Configuration docsWebsite:hyperfetch.onlineUsing this packageTo use this package please do the following:Create a virtual environment in your favorite IDE.Install virtualenv if you haven'tpip install virtualenvCreate a virtual environmentvirtualenv [some_name]Activate virtualenv this way (Linux/MacOS):source myvenv/bin/activateInstall theprerequisites.Install the pip-module.pip install hyperfetchExample 1: tuning + postingHere is a quick example of how to tune and run PPO in the Pendulum-v1 environment inside your new or existing project:1. Create configuration file using YAML (minimal example)If you are unsure of which configuration values to use, see theconfig docs# Required (example values)alg:ppoenv:Pendulum-v1project_name:some_projectgit_link:github.com/user/some_project# Some other useful parameterssampler:tpetuner:mediann_trials:20log_folder:logs2. Tune and post using python file or the command linefromhyperfetchimporttuning# Path to your YAML config fileconfig_path="../some_folder/config_name.yml"# Writes each trial's best hyperparameters to log foldertuning.tune(config_path)Command line:If in the same directory as the config file and the config file is called "config.yml"tune config.ymlIf the config file is in another directory and it's called "config.yml"tune path/to/config.ymlEnjoy your hyperparameters!Example 2: Posting hyperparameters that are not tuned by HyperfetchJust a reminder:The pip package must be installed before this can be done.
For details, seeusing the pip module.1. Create configuartion  YAML fileIf you are unsure of which configuration values to use, see theconfig docs# Required (example values)alg:dqnenv:Pendulum-v1project_name:some_projectgit_link:github.com/user/some_projecthyperparameters:# These depend on the choice of algorithmbatch_size:256buffer_size:50000exploration_final_eps:0.10717928118310233exploration_fraction:0.3318973226098944gamma:0.9learning_rate:0.0002126832542803243learning_starts:10000net_arch:mediumsubsample_steps:4target_update_interval:1000train_freq:8# Not required (but appreciated if you have the data)CO2_emissions:0.78#kgsenergy_consumed:3.27#kWhcpu_model:12th Gen Intel(R) Core(TM) i5-12500Hgpu_model:NVIDIA GeForce RTX 3070total_time:0:04:16.842800# Format: H:M:S:MS2. Post using python file or command linePython file:fromhyperfetchimporttuning# Path to your YAML config fileconfig_path="../some_folder/config_name.yml"# Writes each trial's best hyperparameters to log foldertuning.save(config_path)Command line:If in the same directory as the config file and the config file is called "config.yml"save config.yml