这是indexloc提供的服务,不要输入任何密码
Skip to content

Automatically batch tuple/dict obs #38

@DrJimFan

Description

@DrJimFan
  • I have marked all applicable categories:
    • exception-raising bug
    • RL algorithm bug
    • documentation request (i.e. "X is missing from the documentation.")
    • new feature request
  • I have visited the source website, and in particular read the known issues
  • I have searched through the issue categories for duplicates
  • I have mentioned version numbers, operating system and environment, where applicable:
    import tianshou, torch, sys
    print(tianshou.__version__, torch.__version__, sys.version, sys.platform)

Related to issue #27 : I have a multimodal observation space that consists of image, optical flow, segmentation mask (int array), and other low-dimensional states. The current obs seems to support only a single uniform tensor. Is there any way to have tuple/dict obs that gets collated along the batch dimension? For example, pytorch provides collate_fn that preserves data structure: https://pytorch.org/docs/stable/data.html#dataloader-collate-fn
For now I can put the other obs in info, but I have to manually batch them at run time, which can be tedious and error-prone.

Metadata

Metadata

Assignees

Labels

enhancementFeature that is not a new algorithm or an algorithm enhancementgood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions