starting-kit
starting-kit copied to clipboard
[notebook] add `keras` implementation
I translated the PyTorch code to the Keras code.
@eleniTriantafillou A gentle reminder. This PR might be helpful for Keras users in the upcoming competitions.
thanks a lot @innat for this contribution! It would be indeed great to have an example notebook for those that wish to use keras.
However, for the competition, participants will submit an unlearn function that expects its first argument to be a Pytorch model and the rest Pytorch dataset loaders. Hence I'm afraid having an example that doesn't respect this API will cause confusion in participants.
Would it be possible to re-do your example, but where the unlearn function respects the submission API (and converts between Pytorch model and loader within this function? This would be really helpful for other participants!
@fabianp Thanks for the comment. Made some changes accordingly to your comments.
Hi @innat . I'm confused as I don't see any conversion from keras models and loaders to Pytorch.
Can you confirm that the unlearning method would work giving it as input Pytorch model and Pytorch loaders?
@fabianp Sorry for the confusion.
In the upcoming Kaggle competition, will the participants need to convert their models and data loader to the PyTorch ecosystem?
Generally, in Kaggle, submissions should be ok either PyTorch or TensorFlow (Keras), unless there are some exceptions. For example, 1, 2, these competitors (hosted by Google). People can use whatever framework they like but the submission should be in TensorFlow. So, in this unlearning competition, should it be submitted in PyTorch?
In the upcoming Kaggle competition, will the participants need to convert their models and data loader to the PyTorch ecosystem?
that is exactly right. Participants can use any library as long as they provide a function that takes as input pytorch model and loader and return a pytorch model. Hence, if a participant decides to use a different framework he/she would need to convert pytorch models and loaders to those of the chosen framework (and back)
@fabianp Thanks for the clarification.
.. if a participant decides to use a different framework he/she would need to convert pytorch models and loaders ...
This can be done. However few complications to adding all in a single starter notebook,
- The conversion code (for data loader and model) may create a distraction to the main goal (machine unlearning task) if that is added in the middle of the notebook (right before the unlearning method). (major concern)
- The conversion code may not be general for all cases. Participants might use it in the actual competition and might face issues. (can be resolved)
- GPU memory consumption of both frameworks. (can be resolved)
What if,
- A new section is added at the end of the notebook demonstrating the submission process, i.e. converting the data loader and model to the supported formats.
Hi @innat . That solution of adding it to a section at the end of the document sounds good to me
Great. I will update accordingly.
@fabianp Hi. I have re-implemented the PyTorch to the new Keras-Core with the PyTorch backend. Could you please check this updated version from here? It addresses all the issues previously had. Please let me know, after confirmation, I will update this PR with this new notebook. Thank you.
Thanks @innat . Given the length of the notebook it seems to me that it would be more useful to keep it as a separate notebook as you have done and link it from this repo's README so other participants can use it.
I've done this in https://github.com/unlearning-challenge/starting-kit/commit/beafbcdee7b9d51d11a251aab8f5eea47d02379c
Thanks!