prescient-design / cortex

A Modular Architecture for Deep Learning Systems
Apache License 2.0
36 stars 3 forks source link

Add a dataloader constructor from numpy arrays #7

Closed miguelgondu closed 1 month ago

miguelgondu commented 2 months ago

To train e.g. SequenceModelTree one needs a specific type of combined dataloaders. These are currently built from the task dicts which are attached to the model dynamically on self.build_tree.

Would it be feasible to create these combined dataloaders from numpy arrays? I imagine something like

train_dataloader, val_dataloader = model.get_dataloaders_from_numpy(x, y, **other_kwargs)

where x.shape == [dataset_size, sequence_length] and y.shape = [dataset_size, num_tasks], and the sizes of the dataloaders, batch sizes, and so on are specified through the **other_kwargs.