Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Mimir-RL

Mimir-RL is a Python library that implements RL algorithms using PyTorch and PyTorch RL that are tightly integrated with Mimir.

Dead-end detection

Pass an optional state/goal detector callable to a trajectory sampler:

import pymimir as mm
from pymimir_rl import BoltzmannTrajectorySampler, CachedDeadEndDetector

detector = CachedDeadEndDetector(mm.H2DeadEndDetector)
sampler = BoltzmannTrajectorySampler(
    model, reward_function, temperature=0.5, dead_end_detector=detector,
)

For h², construct problems with generator="grounded". The cache creates one native detector per problem. Trajectory calls it after sampling, in state order, and propagates each proof forward for the same goal. Existing reward-function proofs and actionless non-goal states also provide dead-end evidence.

Detected states with applicable actions do not terminate or prune rollouts. Transition.successor_is_dead_end is separate from is_terminal, and ordinary rewards are preserved. Optimizers assign fixed dead-end targets without bootstrapping from those successors. Hindsight cloning recomputes labels for its new goal using the same detector cache.

OffPolicyAlgorithm accepts dead_end_replay_buffer and hindsight_replay_buffer. The former receives a suffix of each trajectory containing a proven dead state. By default it starts with the transition entering the first proven dead state. An earlier state whose recorded maximum Q-value is at most -10000 * dead_end_q_factor moves the cutoff to the transition entering that state. dead_end_q_factor defaults to 0.25 (threshold -2500) and must be in (0, 1]. Nonfinite predictions do not move the cutoff. Selection uses the recorded maximum over all applicable actions and requires no additional inference.

The Q-based cutoff only selects replay experience; it does not create dead-end labels or change targets. All sampled trajectories remain intact for hindsight refinement. Unproven horizon cutoffs do not qualify for the dead-end buffer, even if their Q-values are low.

Release files for pymimir-rl 0.3.0b4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymimir-rl 0.3.0b4
File Size Uploaded
pymimir_rl-0.3.0b4.tar.gz 59.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pymimir-rl 0.3.0b4
File Interpreter ABI Platform
pymimir_rl-0.3.0b4-py3-none-any.whl Python 3 none any Details

Total release size: 118.7 kB

Release files / pymimir_rl-0.3.0b4.tar.gz

Download URL pymimir_rl-0.3.0b4.tar.gz
Size 59.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7c4f02ce6e8ebbd9f7c6b639fed58e3e5f4e6aab9db4e60ab1736a78a13b4782
BLAKE2b-256 checksum
How to use checksums
a1cf31ebc0aae0fee2a9cd1225c88749a7f10e13af18c1a3e7305efd4e199ca4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pymimir_rl-0.3.0b4-py3-none-any.whl

Download URL pymimir_rl-0.3.0b4-py3-none-any.whl
Size 58.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8d79c61a4778a132ef25748a06cc3757d8c01f2188e04e063cace149257b4b6
BLAKE2b-256 checksum
How to use checksums
be3a4f7506a7a4b25c19b53423c4fecea508d979c12d3686fa052206f2632dc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page