Skip to main content

A tiny, well-tested epsilon-greedy action selector for Reinforcement Learning with action masking. Created by Aditya Singh for B.Tech AI (RL Practicum, NMIMS MPSTME).

Project description

Epsilon-Greedy

A minimal, tested epsilon-greedy action selector for Reinforcement Learning. Includes action masking and tie-aware probability allocation.

Usage

from epsgreedy import epsilon_greedy

action_values = [1.2, 0.5, 1.2, -0.3]   # Q(s, ·)
# Mask out invalid actions (e.g., action 1 is invalid here)
invalid = [False, True, False, False]

a, p = epsilon_greedy(action_values, epsilon=0.1, invalid=invalid)
print(a, p)  # chosen action index, probabilities over actions

Install

pip install aditya-epsgreedy-20251112

Testing

pip install pytest
pytest -q

License

MIT

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

aditya_epsgreedy_20251112-0.0.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

aditya_epsgreedy_20251112-0.0.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file aditya_epsgreedy_20251112-0.0.1.tar.gz.

File metadata

File hashes

Hashes for aditya_epsgreedy_20251112-0.0.1.tar.gz
Algorithm Hash digest
SHA256 55e498bff3e0ff86de5592cdc305868c995f0341aeec42a55217c931a386134b
MD5 7ed5fdd19b44d5c62db76dd4ec6073b7
BLAKE2b-256 cdfab1207ade52de6b460f3660ee761cd3d844d619168f5a033e2b0e01c0b346

See more details on using hashes here.

File details

Details for the file aditya_epsgreedy_20251112-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aditya_epsgreedy_20251112-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d448ae4b6319b43a2f77ecf684afe425165206fa231a9aaf7a923005bd22ea00
MD5 d189eebc6bb93c80edfa0658f3b14565
BLAKE2b-256 bcbe935452b267eb19f8dad114703f222a14646dc25cf65deb6c72739eeb6fdc

See more details on using hashes here.

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