fzi-forschungszentrum-informatik / TSInterpret

An Open-Source Library for the interpretability of time series classifiers
BSD 3-Clause "New" or "Revised" License
115 stars 8 forks source link

Sample and label not aligned in Documentation #62

Closed LbzSteven closed 5 months ago

LbzSteven commented 6 months ago

Describe the bug In the how-to documentation:https://fzi-forschungszentrum-informatik.github.io/TSInterpret/Notebooks/TSEvo_torch/

test_loader = torch.utils.data.DataLoader(test_dataset,batch_size=1,shuffle=True) bservation_01, label_01 = test_dataset[0] model.eval() y_pred,labels= get_all_preds(model,test_loader) label_01=np.array([y_pred[0]]) print(observation_01.shape) print(label_01.shape)

The test loader will undergo the shuffle and the label of the first batch will not be the first one in the dataset. In the sample code, the oberservation_01 is from the first of test_dataset and label_01 is given as the value of y_pred[0], they are not aligned I think.

JHoelli commented 5 months ago

Hi @LbzSteven,

thanks for reporting the issue. I think I fixed it in the most notebooks.

Feel free to come back with any other issue you find.