ikostrikov / pytorch-a2c-ppo-acktr-gail

PyTorch implementation of Advantage Actor Critic (A2C), Proximal Policy Optimization (PPO), Scalable trust-region method for deep reinforcement learning using Kronecker-factored approximation (ACKTR) and Generative Adversarial Imitation Learning (GAIL).
MIT License
3.57k stars 829 forks source link

Fix GAIL expert dataloader #192

Closed ranamihir closed 4 years ago

ranamihir commented 5 years ago

Set drop_last=True only if the dataset size is more than GAIL batch size (otherwise it just returns an empty dataloader). See example below:

>>> from torch.utils.data.sampler import BatchSampler, SequentialSampler
>>> list(BatchSampler(SequentialSampler(range(10)), batch_size=11, drop_last=True))
[]