Skip to main content

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:

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:

DQN cartpole episde rewards DQN cartpole gif

PPO Cartpole:

PPO CartPole episode rewards PPO CartPole gif

PPO Lunar Lander:

PPO Lunar Lander episode rewards PPO Lunar Lander gif

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kioku_rl-0.1.2.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kioku_rl-0.1.2-py3-none-any.whl (39.8 kB view details)

Uploaded Python 3

File details

Details for the file kioku_rl-0.1.2.tar.gz.

File metadata

  • Download URL: kioku_rl-0.1.2.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

Hashes for kioku_rl-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a5512316bf05f6b6efa7d9447086ef7c5a0722ac31fd008d6e1108b798a1abab
MD5 c0e667b4d09644d99e98573eb0f78934
BLAKE2b-256 f605e98f198eabba0ec0da7fedefbe5f7ff80cab4d7f244f76fd3138aca6c26c

See more details on using hashes here.

Provenance

The following attestation bundles were made for kioku_rl-0.1.2.tar.gz:

Publisher: publish.yml on smntic/kioku

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kioku_rl-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: kioku_rl-0.1.2-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

Hashes for kioku_rl-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 96a14acacd6247c56e240ba2fa2a88d296c8d9bf9e2289d3675c20f4d9b1f2a9
MD5 b1b542fcc909316f8c38a2e2d256bc0d
BLAKE2b-256 3d138c209a4459681fc38fa1158e44f10eb6dac5580331840544405050dd8e25

See more details on using hashes here.

Provenance

The following attestation bundles were made for kioku_rl-0.1.2-py3-none-any.whl:

Publisher: publish.yml on smntic/kioku

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page