narla.runner

Job

class narla.runner.Job(settings, process)[source]

Bases: object

A Job is executed by the Runner

Parameters
  • settings (Settings) – Settings for an individual MultiAgentNetwork

  • process (Popen) – Process the Job is running on

is_done()[source]

If True the Job has completed

Return type

bool

Runner

class narla.runner.Runner(all_settings, available_gpus=(0,), jobs_per_gpu=1)[source]

Bases: object

A Runner will execute a list of Settings across available GPUs

Parameters
  • all_settings (List[Settings]) – List of Settings. Will execute a run of main.py per Setting

  • available_gpus (List[int]) – List of available GPU device IDs

  • jobs_per_gpu (int) – Number of Jobs to put on each GPU

execute()[source]

Execute a Job for each group of Settings passed to the runner. Will distribute Jobs evenly across GPUs as they become available

is_done()[source]

Returns True if all Jobs have completed

Return type

bool

RunnerSettings

class narla.runner.RunnerSettings(settings=<factory>, environments=(<GymEnvironments.CART_POLE: 'CartPole-v1'>, ), gpus=(0, ), jobs_per_gpu=2, learning_rates=(0.01, 0.001, 0.0001), local_connectivity=(False, True), neuron_types=(<NeuronTypes.POLICY_GRADIENT: 'policy_gradient'>, <NeuronTypes.DEEP_Q: 'deep_q'>, <NeuronTypes.ACTOR_CRITIC: 'actor_critic'>), number_of_layers=range(2, 11), number_of_neurons_per_layer=(15, ), reward_types=<factory>)[source]

Bases: narla.settings.base_settings.BaseSettings

environments: List[narla.environments.available_environments.GymEnvironments] = (<GymEnvironments.CART_POLE: 'CartPole-v1'>,)

Environment to train on

gpus: List[int] = (0,)

GPU ID to run on

jobs_per_gpu: int = 2

Number of Jobs to put on each GPU

learning_rates: List[float] = (0.01, 0.001, 0.0001)

Learning rates for the individual neuron networks

local_connectivity: List[bool] = (False, True)

If True Network will use local connectivity

neuron_types: List[narla.neurons.neuron_types.NeuronTypes] = (<NeuronTypes.POLICY_GRADIENT: 'policy_gradient'>, <NeuronTypes.DEEP_Q: 'deep_q'>, <NeuronTypes.ACTOR_CRITIC: 'actor_critic'>)

What to of neuron to use in the network

number_of_layers: List[int] = range(2, 11)

Total number of layers to use in the network

number_of_neurons_per_layer: List[int] = (15,)

Number of neurons per layer in the network (the last layer always has only one neuron)

product()[source]

Create the product of all Settings based on the RunnerSettings values

Return type

List[Settings]

reward_types: list

Type of reward to use during training

settings: narla.settings.settings.Settings