Skip to content

Commit

Permalink
[Feature] init_random_frames to prefill replay buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobettini committed Dec 6, 2023
1 parent 0d54682 commit c73e94a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions benchmarl/conf/experiment/base_experiment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ off_policy_n_optimizer_steps: 1000
off_policy_train_batch_size: 128
# Maximum number of frames to keep in replay buffer memory for off-policy algorithms
off_policy_memory_size: 1_000_000
# Number of random action frames to prefill the replay buffer with
off_policy_init_random_frames: 0


evaluation: True
Expand Down
4 changes: 4 additions & 0 deletions benchmarl/experiment/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class ExperimentConfig:
off_policy_n_optimizer_steps: int = MISSING
off_policy_train_batch_size: int = MISSING
off_policy_memory_size: int = MISSING
off_policy_init_random_frames: int = MISSING

evaluation: bool = MISSING
render: bool = MISSING
Expand Down Expand Up @@ -447,6 +448,9 @@ def _setup_collector(self):
storing_device=self.config.train_device,
frames_per_batch=self.config.collected_frames_per_batch(self.on_policy),
total_frames=self.config.get_max_n_frames(self.on_policy),
init_random_frames=self.config.off_policy_init_random_frames
if not self.on_policy
else 0,
)

def _setup_name(self):
Expand Down

0 comments on commit c73e94a

Please sign in to comment.