Spec File

A spec file is used to fully specify experiments. It is a JSON of multiple experiment specs, each containing the keys agent, env, body, meta, search.

For reproducibility, an experiment will save a copy of the spec used, along with the git SHA commit of SLM-Lab it ran on.

A spec_util.py automatically checks the format before the lab runs.

For example, spec/experimental/dqn.json may look like this:

{
  "dqn_cartpole": {
    "agent": [{
      "name": "DQN",
      "algorithm": {
        ...
      }
    }],
    "env": [{
      "name": "CartPole-v0",
      "max_timestep": null,
      "max_episode": 1000
    }],
    "body": {
      "product": "outer",
      "num": 1
    },
    "meta": {
      "max_session": 4,
      "max_trial": 50,
      "train_mode": true
    },
    "search": {
      "agent": [{
        "algorithm": {
          "gamma__uniform": [0.9, 0.9999]
        },
        "net": {
          "hid_layers__choice": [[16], [32], [64]]
        }
      }]
    }
  }
}

At initialization, the spec is applied to the relevant components. The keys are agent, env, body, meta, search.

The spec name is the experiment name, so give it a name that describes the experiment you're doing. Also, since this is a JSON, all keys must be unique (no repeated spec names).

results matching ""

    No results matching ""