I created a custom dataset by using the
AvalancheDataset class and the
dataset_benchmark function, hence obtaining a
GenericCLScenario instance. Everything works fine, the dataset is correct and I can use it without any problems.
Now, my aim is to extract, for each stream and experience in the
GenericCLScenario, the class labels contained in such experience.
I am aware that the class has the property
classes_in_experience, however that returns a set of tensors (containing the labels), which is not optimal to quickly extract the unique class labels.
Is there a better way to obtain the class labels from a
Thanks for your attention.
Hi @DWarez, using the sintax
self.classes_in_experience[stream_name][experience_id] would give you access to a set of unique class ids for a specific experience. Is this what you want, right?
You are using that
classes_in_experience contains tensors and their values are not unique? If so, this may be a bug. If you post an issue on github with code to reproduce it we can fix it.
Hello, thanks a lot for the replies.
As @AntonioCarta said, it seems like that
classes_in_experience returns a set containing non-unique values (I have no idea how this is possible since I recall that in Python sets cannot contain the same item more than one).
This is the output I get while debugging. Note that
self.data is an attribute that contains the return value of the function
As you can see the set contains the collection of labels, which implies that the same class-label is repeated several times.
I cannot share the code since it’s under a NDA, however I can try to replicate the bug and eventually open a GitHub issue, if this isn’t the expected behavior.
yes, this is unexpected. The dataset constructor should convert the tensor to a list internally (otherwise the equality doesn’t work), but in your case it isn’t.
Thank you Antonio, I opened an issue here, even though I haven’t managed to write a MWE yet. I hope this can still help in fixing the bug.