Cognitive science-inspired reinforcement learning research library
Project description
Kioku
A cognitive science-inspired reinforcement learning research library. Kioku is designed to be modular and give you tools to experiment with classical and modern RL algorithms and build your own.
Features
Kioku currently includes implementations of DQN, A2C and PPO, along with reusable components for memory buffers, schedulers, models and environments. It supports the following agents based on classical and SOTA RL methods:
- DQN
- Based on: Playing Atari with Deep Reinforcement Learning
- Uses Q-value function with Polyak averaging and epsilon decay
- DQN with PER
- Adds a priotized experience replay buffer based on: Prioritized Experience Replay
- A2C
- Based on: Asynchronous Methods for Deep Reinforcement Learning
- Uses N-step returns
- PPO
- Based on: Proximal Policy Optimization Algorithms
- Uses Generalized Advantage Estimation, N-step returns, mini-batch learning, multiple learning iterations per batch.
Installation
Install via PyPI:
pip install kioku-rl
Usage
Run an example:
python examples/ppo_cartpole.py
or use it in your own programs as a library:
from kioku.schedulers import StaticScheduler
from kioku.environments import GymEnvironment
from kioku.agents import PPOAgent
from kioku.trainers import Trainer
from kioku.utils import set_seed
set_seed(42)
env = GymEnvironment("CartPole-v1")
render_env = GymEnvironment("CartPole-v1", render_mode="human")
agent = PPOAgent(
observation_size=env.observation_size,
num_actions=env.action_size,
learning_rate=StaticScheduler(1e-3)
)
trainer = Trainer(agent, env)
trainer.train(100000)
tester = Trainer(agent, render_env)
results = tester.test(10)
Results
DQN Cartpole:
PPO Cartpole:
PPO Lunar Lander:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kioku_rl-0.1.1.tar.gz.
File metadata
- Download URL: kioku_rl-0.1.1.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c2a38a84314c44f3ea41e778e7bfd84b56f1f6677b417e61028330a3e03050f
|
|
| MD5 |
15d0739a741bae7d9a41a0c043bd8746
|
|
| BLAKE2b-256 |
9d795c4e9b53f5e57702ddb56e9a35ffa3ab1766c8218db69d630e4f1db1cb07
|
Provenance
The following attestation bundles were made for kioku_rl-0.1.1.tar.gz:
Publisher:
publish.yml on smntic/kioku
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kioku_rl-0.1.1.tar.gz -
Subject digest:
2c2a38a84314c44f3ea41e778e7bfd84b56f1f6677b417e61028330a3e03050f - Sigstore transparency entry: 789110104
- Sigstore integration time:
-
Permalink:
smntic/kioku@dad54a6eff6d014689412dd8263a2b038a1c61d7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/smntic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dad54a6eff6d014689412dd8263a2b038a1c61d7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kioku_rl-0.1.1-py3-none-any.whl.
File metadata
- Download URL: kioku_rl-0.1.1-py3-none-any.whl
- Upload date:
- Size: 39.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67043145dfacc25a2b94c4567939e29d1f593b3ff47c3bfeefc9c3cccfe73858
|
|
| MD5 |
b33a51323c1a62bfad0a8a3dac951b27
|
|
| BLAKE2b-256 |
4723ab67d317ea55c466241c2f675612234b0556174e8c497d63d1cb97305e71
|
Provenance
The following attestation bundles were made for kioku_rl-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on smntic/kioku
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kioku_rl-0.1.1-py3-none-any.whl -
Subject digest:
67043145dfacc25a2b94c4567939e29d1f593b3ff47c3bfeefc9c3cccfe73858 - Sigstore transparency entry: 789110106
- Sigstore integration time:
-
Permalink:
smntic/kioku@dad54a6eff6d014689412dd8263a2b038a1c61d7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/smntic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dad54a6eff6d014689412dd8263a2b038a1c61d7 -
Trigger Event:
push
-
Statement type: