sim.py:
- simulator.update(return_uncertainty=True) calls forward_with_uncertainty
on kNN models and returns the GP std; returns None for NN or when not
requested (no extra cost if unused)
- No state stored on simulator; caller decides what to do with the value
rl.py (NuconEnv and NuconGoalEnv):
- uncertainty_penalty_start: above this GP std, subtract a linear penalty
from the reward (scaled by uncertainty_penalty_scale, default 1.0)
- uncertainty_abort: at or above this GP std, set truncated=True
- Only calls update(return_uncertainty=True) when either threshold is set
- Uncertainty only applies when using a simulator (kNN model); ignored otherwise
Example:
simulator = NuconSimulator()
simulator.load_model('reactor_knn.pkl')
env = NuconGoalEnv(..., simulator=simulator,
uncertainty_penalty_start=0.3,
uncertainty_abort=0.7,
uncertainty_penalty_scale=2.0)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| drake_assets | ||
| __init__.py | ||
| core.py | ||
| drake.py | ||
| model.py | ||
| rl.py | ||
| sim.py | ||