| import datasets | |
| class HumanoidValidDataset(datasets.GeneratorBasedBuilder): | |
| VERSION = datasets.Version("1.0.0") | |
| def _info(self): | |
| return datasets.DatasetInfo( | |
| description="Simple humanoid robot training dataset", | |
| features=datasets.Features( | |
| { | |
| "state": datasets.Value("float32"), | |
| "action": datasets.Value("float32"), | |
| } | |
| ), | |
| supervised_keys=None, | |
| license="mit", | |
| ) | |
| def _split_generators(self, dl_manager): | |
| return [ | |
| datasets.SplitGenerator( | |
| name=datasets.Split.TRAIN, | |
| gen_kwargs={}, | |
| ) | |
| ] | |
| def _generate_examples(self): | |
| data = [ | |
| {"state": 0.1, "action": 0.2}, | |
| {"state": 0.2, "action": 0.3}, | |
| {"state": 0.3, "action": 0.4}, | |
| ] | |
| for idx, item in enumerate(data): | |
| yield idx, item | |