zap-thamm's picture
Upload of a new agent
236a3f3 verified
metadata
tags:
  - CartPole-v1
  - reinforcement-learning
  - rl-framework
model-index:
  - name: Imitation-BC-CartPole-v1
    results:
      - task:
          type: reinforcement-learning
          name: reinforcement-learning
        dataset:
          name: CartPole-v1
          type: CartPole-v1
        metrics:
          - type: mean_reward
            value: 500.00 +/- 0.00
            name: mean_reward
            verified: false

Custom implemented PPO agent playing on CartPole-v1

This is a trained model of an agent playing on the environment CartPole-v1. The agent was trained with a PPO algorithm. See further agent and evaluation metadata in the according README section.

Import

The Python module used for training and uploading/downloading is rl-framework. It is an easy-to-read, plug-and-use Reinforcement Learning framework and provides standardized interfaces and implementations to various Reinforcement Learning methods and environments.

Also it provides connectors for the upload and download to popular model version control systems, including the HuggingFace Hub.

Usage


from rl-framework import ImitationAgent, ImitationAlgorithm

# Create new agent instance
agent = ImitationAgent(
    algorithm=ImitationAlgorithm.PPO
    algorithm_parameters={
        ...
    },
)

# Download existing agent from HF Hub
repository_id = "zap-thamm/Imitation-BC-CartPole-v1"
file_name = "agent.pkl"
agent.download(repository_id=repository_id, filename=file_name)

Further examples can be found in the exploration section of the rl-framework repository.