Algorithm

Code: slm_lab/agent/algorithm

Algorithm is the main class which implements an RL algorithm. This includes declaring its networks and variables, acting, sampling from memory, and training. It initializes its networks and memory by simply calling the Memory and Net classes with their specs. The loss functions for the algorithms is also implemented here.

Each algorithm comes with a number of hyperparameters that can be specified through a agent spec file.

Algorithm Spec

{
    ...
    "agent": [{
      "name": str,
      "algorithm": {
        "name": str,
        "action_pdtype": str,
        "action_policy": str,
        "gamma": float,
        ...,
      },
      ...
    }],
    ...
}

Other algorithm spec hyperparameters are specific to algorithm implementations. For those, refer to the class documentation of algorithms in slm_lab/agent/algorithm.

For more concrete examples of algorithm spec specific to algorithms, refer to the existing spec files.

To learn more about algorithms, check out Deep RL Resources.

The subpages to follow showcase a subset of algorithms in SLM Lab. See here for the list of implemented algorithms in SLM Lab.

Last updated