Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: epignatelli
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Size: 43.9 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 1
  • Releases: 2
Created over 2 years ago · Last pushed over 2 years ago
Metadata Files
Readme License Citation Authors

README.md

HELX: The RL experiments framework

Project Status: WIP  Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. CI CD GitHub release (latest by date)

Quickstart | Installation | Examples | Cite

What is HELX?

HELX is a JAX-based ecosystem that provides a standardised framework to run Reinforcement Learning experiments. With HELX you easily can: - Use the helx.envs namespace to use the most common RL environments (gym, gymnax, dm_env, atari, ...) - Use the helx.agents namespace to use the most common RL agents (DQN, PPO, SAC, ...) - Use the helx.experiment namespace to run experiments on your local machine, on a cluster, or on the cloud - Use the helx.base namespace to access the most common RL data structures and functions (e.g., a Ring buffer)

Each namespace provides a single, standardised interface to all agents, environments and experiment runners.

Installation

  • Stable

    Install the stable version of helx and its dependencies with: bash pip install helx

  • Nightly

    Or, if you prefer to install the latest version from source: bash pip install git+https://github.com/epignatelli/helx

Examples

A typical use case is to design an agent, and toy-test it on catch before evaluating it on more complex environments, such as atari, procgen or mujoco.

```python import bsuite import gym

import helx.environment import helx.experiment import helx.agents

create the enviornment in you favourite way

env = bsuite.loadfromid("catch/0")

convert it to an helx environment

env = helx.environment.to_helx(env)

create the agent

hparams = helx.agents.Hparams(env.obsspace(), env.actionspace()) agent = helx.agents.Random(hparams)

run the experiment

helx.experiment.run(env, agent, episodes=100) ```

Switching to a different environment is as simple as changing the env variable.

```diff import bsuite import gym

import helx.environment import helx.experiment import helx.agents

create the enviornment in you favourite way

-env = bsuite.loadfromid("catch/0") +env = gym.make("procgen:procgen-coinrun-v0")

convert it to an helx environment

env = helx.environment.to_helx(env)

create the agent

hparams = helx.agents.Hparams(env.obsspace(), env.actionspace()) agent = helx.agents.Random(hparams)

run the experiment

helx.experiment.run(env, agent, episodes=100) ```

Joining development

Adding a new agent (helx.agents.Agent)

An helx agent interface is designed as the minimal set of functions necessary to (i) interact with an environment and (ii) reinforcement learn.

```python from typing import Any from jax import Array

from helx.base import Timestep from helx.agents import Agent

class NewAgent(helx.agents.Agent): """A new RL agent.""" def create(self, hparams: Any) -> None: """Initialises the agent's internal state (knowledge), such as a table, or some function parameters, e.g., the parameters of a neural network.""" # implement me

def init(self, key: KeyArray, timestep: Timestep) -> None:
    """Initialises the agent's internal state (knowledge), such as a table,
    or some function parameters, e.g., the parameters of a neural network."""
    # implement me

def sample_action(
    self, agent_state: AgentState, obs: Array, *, key: KeyArray, eval: bool = False
):
    """Applies the agent's policy to the current timestep to sample an action."""
    # implement me

def update(self, timestep: Timestep) -> Any:
    """Updates the agent's internal state (knowledge), such as a table,
    or some function parameters, e.g., the parameters of a neural network."""
    # implement me

```

Adding a new environment library (helx.environment.Environment)

To add a new library requires three steps: 1. Implement the helx.environment.Environment interface for the new library. See the dm_env implementation for an example. 1. Implement serialisation (to helx) of the following objects: - helx.environment.Timestep - helx.spaces.Discrete - helx.spaces.Continuous 2. Add the new library to the helx.environment.to_helx function to tell helx about the new protocol.


Cite

If you use helx please consider citing it as:

bibtex @misc{helx, author = {Pignatelli, Eduardo}, title = {Helx: Interoperating between Reinforcement Learning Experimental Protocols}, year = {2021}, publisher = {GitHub}, journal = {GitHub repository}, howpublished = {\url{https://github.com/epignatelli/helx}} }

A note on maintainance

This repository was born as the recipient of personal research code that was developed over the years. Its maintainance is limited by the time and the resources of a research project resourced with a single person. Even if I would like to automate many actions, I do not have the time to maintain the whole body of automation that a well maintained package deserves. This is the reason of the WIP badge, which I do not plan to remove soon. Maintainance will prioritise the code functionality over documentation and automation.

Any help is very welcome. A quick guide to interacting with this repository: - If you find a bug, please open an issue, and I will fix it as soon as I can. - If you want to request a new feature, please open an issue, and I will consider it as soon as I can. - If you want to contribute yourself, please open an issue first, let's discuss objective, plan a proposal, and open a pull request to act on it.

If you would like to be involved further in the development of this repository, please contact me directly at: edu dot pignatelli at gmail dot com.

Owner

  • Name: Eduardo Pignatelli
  • Login: epignatelli
  • Kind: user
  • Location: London
  • Company: University College London (UCL)

Assistant Professor (UK Lecturer, Teaching) @ UCL. PhD @ UCL. Previously ML Lead at @BuroHappoldEngineering and RA at @ImperialCollegeLondon

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: 11 minutes
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.5
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • epignatelli (2)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/CD.yml actions
  • TriPSs/conventional-changelog-action v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • ncipollo/release-action v1 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/CI.yml actions
  • actions/checkout v3 composite
  • conda-incubator/setup-miniconda v2 composite
  • mshick/add-pr-comment v2 composite
.github/workflows/triage.yml actions
  • actions-ecosystem/action-add-assignees v1 composite
  • actions/add-to-project v0.4.0 composite
environment.yml pypi
pyproject.toml pypi
requirements.txt pypi
  • helx-agents *
  • helx-base *
  • helx-envs *
  • wandb *