Download rl/v2d_rl/algorithms/base.py from hk239/v2d: direct link, hf CLI and curl.
- Browser
- Download file 623 Bytes
-
https://huggingface.co/datasets/hk239/v2d/resolve/main/rl/v2d_rl/algorithms/base.py
- Command line
-
hf download hf://datasets/hk239/v2d/rl/v2d_rl/algorithms/base.py
-
curl -L -o base.py https://huggingface.co/datasets/hk239/v2d/resolve/main/rl/v2d_rl/algorithms/base.py
623 Bytes
| """Algorithm interface. Concrete PPO / residual / hierarchical details later.""" | |
| from __future__ import annotations | |
| from abc import ABC, abstractmethod | |
| from typing import Any | |
| class Algorithm(ABC): | |
| """Train or roll out a policy against an Isaac Lab vec env.""" | |
| def train(self, env: Any, log_dir: str) -> None: | |
| """Run learning. ``env`` is already wrapped for the library.""" | |
| def load(self, checkpoint: str) -> None: | |
| """Load weights.""" | |
| def act(self, obs: Any) -> Any: | |
| """Return actions for a batch of observations.""" | |