[WIP:] refactoring for tensorflow2 keras compat #229
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was using the Innvestigate library to perform LRP analysis of my Temporal Convolutional Network that I use for predicting fundamental frequency of speech from thousands of linguistic features. The visualisations allow me to see the relevance of feature groups (like type of syllable accent and syllable position) for intonation contours. The algorithm in Innvestigate is great and quite speedy but I found it difficult to use directly with my Tensorflow 2.0 Keras Sequential network. The reason is mainly in the import statements that you use. This PR is a potential discussion starter as I think it would be much better not to import libraries as whole paths, i.e. instead of importing
tensorflow.keras.layers.convolutional.UpSampling1D
we should probably just importUpSampling1D
.Also the eager execution setting in TF and the way I have implemented in my scripts do not allow some operations on tensors like list comprehensions etc. (AFAIK they are simply not yet implemented in the TF API).
If you think this is helpful at all please let me know and I will be happy to help tidy this up or we can discuss this further.
Anyways, thanks you for a great library!