swarmrl.training_routines.ensemble_submit Module API Reference¶
Class for submitting many jobs in parallel to a cluster.
EnsembleTraining
¶
Class for ensemble training.
Source code in swarmrl/training_routines/ensemble_submit.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|
__init__(trainer, simulation_runner_generator, number_of_ensembles, episode_length, n_episodes, n_parallel_jobs=None, load_path=None, cluster=None, output_dir=Path('./ensembled-training'))
¶
Constructor for the ensemble training routine.
Parameters¶
trainer : Trainer The trainer used to train. number_of_ensmbles : int The number of ensembles to train. episode_length : int The length of each episode. n_episodes : int The number of episodes to train for. simulation_runner_generator : callable A callable function that returns a simulation runner. n_parallel_jobs : int The number of parallel jobs to run. cluster : JobQueueCluster The cluster to run the jobs on. If None, the jobs will be run locally. load_path : Path or str or None (default) The path to load the models from. output_dir : Path or str or None (default) The directory to save the models to.
Source code in swarmrl/training_routines/ensemble_submit.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
train_ensemble()
¶
Train the ensemble.
Returns¶
model_performance : dict A dictionary of the model performance. structure of the dictionary is: {model_id: rewards}.
Source code in swarmrl/training_routines/ensemble_submit.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|