You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been facing some (perhaps unnecessary) issues in saving and loading instances of classes from ESCNN.
Say I want to generate a dataset of Equivariant dynamical systems, I would like to save in files the actual symmetry group (subgroup) and the representations of each of the measurements taken.
The representations are ok to save using the irreps ids and the change of basis, but the group itself it's proven a bit harder to save and load elegantly. The group and representation classes are not serializable and thus cannot be pickled. But storing the entire object also seems unnecessary.
I am assuming you have already faced that issue, or if not, that you might have a good idea of how to do this as quickly. Any ideas?
Perhaps I can build (at some point) the protocol for storing and loading this instances
PS: I will answer all other threads we have active after ICLR. Sorry for the delay.
The text was updated successfully, but these errors were encountered:
To efficiently store groups, I implemented this feature (which I also use for caching inside the library).
Each group has a method _keys() which returns a dictionary containing the essential information to instantiate this group.
These attributes are precisely the ones you should pass to a groups' _generator() static method to instantiate it.
The only problem you have left is accessing the _generator() method of the right group class.
This is done with the groups_dict dictionary which associates to each class's name the actual python class.
In other words, to cache an instance g of Group, you just need to cache g.__name__ and g._keys().
Then, you can reinstantiate the group via groups_keys[name]._generator(**keys).
However, I agree the library should include a nice and simple method which hides away these details and can be used to simply cache a representation.
Let me get back to this when I have a little more time.
Yes, this is precisely what I was looking for, and I agree there should be a method for this. A custom serialization and deserialization method can enable pickle saving and loading.
Thanks for the swift answer. Please update if you are taking on this effort; otherwise, whenever I have time, I could try to give it a go.
Hi @Gabri95,
I have been facing some (perhaps unnecessary) issues in saving and loading instances of classes from ESCNN.
Say I want to generate a dataset of Equivariant dynamical systems, I would like to save in files the actual symmetry group (subgroup) and the representations of each of the measurements taken.
The representations are ok to save using the irreps ids and the change of basis, but the group itself it's proven a bit harder to save and load elegantly. The group and representation classes are not serializable and thus cannot be pickled. But storing the entire object also seems unnecessary.
I am assuming you have already faced that issue, or if not, that you might have a good idea of how to do this as quickly. Any ideas?
Perhaps I can build (at some point) the protocol for storing and loading this instances
PS: I will answer all other threads we have active after ICLR. Sorry for the delay.
The text was updated successfully, but these errors were encountered: