Skip to content

[BUG] Librep's TransformMultiModalDataset should return an object with same type as input #10

@otavioon

Description

@otavioon

Describe the bug:
Current librep.datasets.multimodal.TransformMultiModalDataset implementation apply a sequence of transformations to a dataset, resulting in a new dataset. However the resultant dataset is not of the same type as input dataset.

To Reproduce:
The code to verify the behavior:

from librep.datasets.multimodal import TransformMultiModalDataset
from librep.transforms.fft import FFT

kuhar_dataset_path = Path("../data/views/KuHar/balanced_motionsense_equivalent_view")
kh_train, kh_validation, kh_test = PandasDatasetsIO(kuhar_dataset_path).load()

features = [
    "accel-x",
    "accel-y",
    "accel-z",
    "gyro-x",
    "gyro-y",
    "gyro-z"
]

# Creating the datasets

# Train
kh_train_dataset = PandasMultiModalDataset(
    kh_train,
    feature_prefixes=features,
    label_columns="activity code",
    as_array=True
)


fft_transform = FFT()
transformer = TransformMultiModalDataset(transforms=[fft_transform], new_window_name_prefix="fft.")
resampled_kh_train_dataset_fft = transformer(kh_train_dataset)
print(type(kh_train_dataset), type(resampled_kh_train_dataset_fft))

Expected behavior:
The returned type from transformed object should be the same as the input object type.

Desktop:

  • OS: Ubuntu 20.04

Some solutions:
Adapt to use multimodal-array package may be a solution.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions