Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 1.68 KB

skrl.models.tabular.rst

File metadata and controls

51 lines (35 loc) · 1.68 KB

Tabular model

Tabular models run discrete-domain deterministic/stochastic policies.

skrl provides a Python mixin (TabularMixin) to assist in the creation of these types of models, allowing users to have full control over the table definitions. Note that the use of this mixin must comply with the following rules:

  • The definition of multiple inheritance must always include the Model <models_base_class> base class at the end.

    class TabularModel(TabularMixin, Model):
        def __init__(self, observation_space, action_space, device="cuda:0", num_envs=1):
            Model.__init__(self, observation_space, action_space, device)
            TabularMixin.__init__(self, num_envs)
  • The Model <models_base_class> base class constructor must be invoked before the mixins constructor.

    class TabularModel(TabularMixin, Model):
        def __init__(self, observation_space, action_space, device="cuda:0", num_envs=1):
            Model.__init__(self, observation_space, action_space, device)
            TabularMixin.__init__(self, num_envs)

Basic usage

ϵ-greedy policy

../snippets/tabular_model.py

API

skrl.models.torch.tabular.TabularMixin

__init__