Synapse is a framework for implementing Reinforcement Learning (RL) algorithms in PyTorch. The repository includes popular algorithms such as Deep Q-Networks, Policy Gradients, and Actor-Critic, as well as others.
One of the advantages of using Synapse-RL is its compatibility with gym-based environments. Gym provides a standard interface for working with environments to benchmark RL models. Synapse-RL also includes various utility functions and classes that make it easy to experiment with different hyperparameters, test different training approaches, and visualize training results.
RL Algorithm | Description |
---|---|
Deep Q Learning |
Discrete |
Policy Gradient |
Discrete |
Actor Critic (A2C) |
Discrete |
Deep Deterministic Policy Gradient (DDGP) |
Continuous |
Soft Actor Critic (SAC) |
Continuous |
Proximal Policy Optimization (PPO) |
- |
Synapse now supports tensorboard.
tensorboard --logdir ./
import gymnasium as gym
from agents.PolicyGradient import PolicyGradientAgent
# Initialize the CartPole environment and agent
env = gym.make('CartPole-v1')
state_size = env.observation_space.shape[0]
action_size = env.action_space.n
agent = PolicyGradientAgent(state_size, action_size)
result = agent.train(env, episodes=2000)