mlverse / torch

R Interface to Torch
https://torch.mlverse.org
Other
490 stars 64 forks source link

Implement iterable datasets support. #1095

Closed dfalbel closed 1 year ago

dfalbel commented 1 year ago

This allows using datasets that don't have a known length upfront, eg in reinforcement learning scenarios or, in datasets where it's not possible to pre-process the entire data to know the length upfront.

Use the iterable_dataset function to create a Iterable dataset and implement at least the .iter() method, returning a function that returns a new element every time it's called. It should return coro::exhausted() once it has no data to return.