@@ -240,20 +240,7 @@ def __getitem__(self, idx):
240240
241241
242242class DMCDataModule (LightningDataModule ):
243- """Example of LightningDataModule for Atari DQN Replay Buffer dataset.
244-
245- A DataModule implements 5 key methods:
246- - prepare_data (things to do on 1 GPU/TPU, not on every GPU/TPU in distributed mode)
247- - setup (things to do on every accelerator in distributed mode)
248- - train_dataloader (the training dataloader)
249- - val_dataloader (the validation dataloader(s))
250- - test_dataloader (the test dataloader(s))
251-
252- This allows you to share a full dataset without explaining how to download,
253- split, transform and process the data.
254-
255- Read the docs:
256- https://pytorch-lightning.readthedocs.io/en/latest/extensions/datamodules.html
243+ """DMC Dataset for one specific domain and task.
257244 """
258245
259246 def __init__ (
@@ -369,32 +356,12 @@ def val_dataloader(self):
369356
370357 def test_dataloader (self ):
371358 return None
372- # return DataLoader(
373- # self.test_dataset,
374- # shuffle=False,
375- # pin_memory=True,
376- # batch_size=self.hparams.batch_size,
377- # num_workers=self.hparams.num_workers,
378- # persistent_workers=True
379- # )
380359
381360
382361class DMCBCDataModule (LightningDataModule ):
383- """Example of LightningDataModule for behavior cloning on DMC. Only top 10 percent trajectories
384- are used.
385-
386- A DataModule implements 5 key methods:
387- - prepare_data (things to do on 1 GPU/TPU, not on every GPU/TPU in distributed mode)
388- - setup (things to do on every accelerator in distributed mode)
389- - train_dataloader (the training dataloader)
390- - val_dataloader (the validation dataloader(s))
391- - test_dataloader (the test dataloader(s))
392-
393- This allows you to share a full dataset without explaining how to download,
394- split, transform and process the data.
395-
396- Read the docs:
397- https://pytorch-lightning.readthedocs.io/en/latest/extensions/datamodules.html
362+ """DMC dataset on one specific domain and task with data subsampling.
363+ For behavior cloning: only top k percent trajectories (expert data) are used.
364+ For reward-conditioned learning: randomly selected k percent trajectories are used.
398365 """
399366
400367 def __init__ (
@@ -412,7 +379,7 @@ def __init__(
412379 train_replay_id = 1 ,
413380 val_replay_id = 2 ,
414381 select_rate = 0.1 ,
415- rand_select = False ,
382+ rand_select = False , # True for reward-conditioned learning
416383 ):
417384 super ().__init__ ()
418385
0 commit comments