avalanche icon indicating copy to clipboard operation
avalanche copied to clipboard

Hotfix to add_transforms_to_group method in AvalancheDataset

Open evertonaleixo opened this issue 2 years ago • 1 comments

This method has a code mistake when you try to add a new target_transform to a group that is not the current group. I opened a pull request to fix it with some unit tests for future regression tests.

🐜 To Reproduce

dataset_mnist = MNIST(
    root=expanduser("~") + "/.avalanche/data/mnist/", download=True
)
target_transform = lambda label: label+1
dataset = AvalancheDataset(dataset_mnist)
dataset = dataset.add_transforms_to_group(
    group_name='eval', 
    target_transform=target_transform,
)
dataset = dataset.eval()

🐝 Expected behavior

dataset.target_transform == target_transform

🐞 Screenshots If applicable, add screenshots to help explain your problem.

🦋 Additional context Add any other context about the problem here like your python setup.

evertonaleixo avatar Apr 24 '22 15:04 evertonaleixo

I did a pull request #1000.

evertonaleixo avatar Apr 24 '22 15:04 evertonaleixo