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
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 aditya_epsgreedy_20251112-0.0.1.tar.gz.
File metadata
- Download URL: aditya_epsgreedy_20251112-0.0.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55e498bff3e0ff86de5592cdc305868c995f0341aeec42a55217c931a386134b
|
|
| MD5 |
7ed5fdd19b44d5c62db76dd4ec6073b7
|
|
| BLAKE2b-256 |
cdfab1207ade52de6b460f3660ee761cd3d844d619168f5a033e2b0e01c0b346
|
File details
Details for the file aditya_epsgreedy_20251112-0.0.1-py3-none-any.whl.
File metadata
- Download URL: aditya_epsgreedy_20251112-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d448ae4b6319b43a2f77ecf684afe425165206fa231a9aaf7a923005bd22ea00
|
|
| MD5 |
d189eebc6bb93c80edfa0658f3b14565
|
|
| BLAKE2b-256 |
bcbe935452b267eb19f8dad114703f222a14646dc25cf65deb6c72739eeb6fdc
|