eloialonso / iris

Transformers are Sample-Efficient World Models. ICLR 2023, notable top 5%.
https://openreview.net/forum?id=vhFu1Acb0xb
GNU General Public License v3.0
805 stars 80 forks source link

The role of sampling_weights. #10

Closed Yingdong-Hu closed 1 year ago

Yingdong-Hu commented 1 year ago

Hi, what's the function of sampling_weights in trainer.yaml ? sampling_weights: [0.125, 0.125, 0.25, 0.5]

It seems that weights=1 are always used for all the episodes in function _sample_episodes_segments in dataset.py.

eloialonso commented 1 year ago

Hi, this is a simple way to sample recent experience more often.

In _sample_episodes_segments, we use equal weights (no effect) if weights is None or if there isn't enough episodes in the dataset.

Otherwise, the nth weight corresponds to the probability of sampling an episode in the nth chunk of the dataset in chronological order.

For instance, with weights = [0.125, 0.125, 0.25, 0.5], there is a 0.5 probability that an episode from the most recent quarter of the dataset will be sampled.

Yingdong-Hu commented 1 year ago

I understand, thank you!

eloialonso commented 1 year ago

Sorry for the misunderstanding, this was indeed a bug (reported again in #18). We removed this feature as it was not used during our experiments.