Development Utilities
Development utilities:
Reward-function reference plots
The manual reward plotter evaluates the implemented reward terms using CPU Torch
and writes PDF references. From a source checkout with the plots extra installed
(Matplotlib, NumPy, Torch and Seaborn), use its existing function to choose an
output directory:
MPLBACKEND=Agg uv run --extra plots python - <<'PY'
from pathlib import Path
import matplotlib.pyplot as plt
from srb.core.reward.scripts.plot_reward_terms import plot_library_final_order
output = Path("outputs/reward_terms")
output.mkdir(parents=True, exist_ok=True)
plot_library_final_order(weight=1.0, limit=4.0, output_path=output / "reward_terms.pdf")
plot_library_final_order(weight=-2.0, limit=64.0, output_path=output / "penalty_terms.pdf")
plt.close("all")
PY
Agg runs without a display. The PDFs illustrate mathematical reward functions;
they do not validate a task’s dynamics or learned behavior. Directly executing
srb/core/reward/scripts/plot_reward_terms.py retains its original behavior of
writing both PDFs beside the script; the function invocation above keeps generated
files under outputs/.
For the manual TF trajectory visualizer, see the ROS integration guide.