Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add class mapping of categorical model #216

Merged
merged 3 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion skrl/utils/runner/jax/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from skrl.resources.schedulers.jax import KLAdaptiveLR # noqa
from skrl.trainers.jax import SequentialTrainer, Trainer
from skrl.utils import set_seed
from skrl.utils.model_instantiators.jax import deterministic_model, gaussian_model
from skrl.utils.model_instantiators.jax import categorical_model, deterministic_model, gaussian_model


class Runner:
Expand All @@ -35,6 +35,7 @@ def __init__(self, env: Union[Wrapper, MultiAgentEnvWrapper], cfg: Mapping[str,
self._class_mapping = {
# model
"gaussianmixin": gaussian_model,
"categoricalmixin": categorical_model,
"deterministicmixin": deterministic_model,
"shared": None,
# memory
Expand Down
3 changes: 2 additions & 1 deletion skrl/utils/runner/torch/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from skrl.resources.schedulers.torch import KLAdaptiveLR # noqa
from skrl.trainers.torch import SequentialTrainer, Trainer
from skrl.utils import set_seed
from skrl.utils.model_instantiators.torch import deterministic_model, gaussian_model, shared_model
from skrl.utils.model_instantiators.torch import categorical_model, deterministic_model, gaussian_model, shared_model


class Runner:
Expand All @@ -35,6 +35,7 @@ def __init__(self, env: Union[Wrapper, MultiAgentEnvWrapper], cfg: Mapping[str,
self._class_mapping = {
# model
"gaussianmixin": gaussian_model,
"categoricalmixin": categorical_model,
"deterministicmixin": deterministic_model,
"shared": shared_model,
# memory
Expand Down
Loading