marpyr / Lorentz_workshop

3 stars 0 forks source link

Add explain.py with wrapper for 5-CNN model inputs #10

Closed loostrum closed 2 years ago

loostrum commented 2 years ago

This PR adds some code to handle the 5-input case for the CNN. The assumption is that only one of those inputs will be perturbed by the XAI method. The uses gives the 4 constant inputs to the wrapper function, and tells it where the fifth input belongs. The fifth input, i.e. the one that will be perturbed, is given to dianna.explain_image. The wrapper function is given as preprocess_function to dianna.explain_image and handles reconstructing the proper input shape.