-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InceptionTime model does not classify correctly when "residual=True" #29
Comments
Hello @maxzoll, According to the following lines (16 and 17):
The residual parameter of the InceptionModule is always set at this default value False . Moreover there is no use_residual parameter anymore in InceptionTime to allow its use.
To be closer from the original Keras implementation (https://github.com/hfawaz/InceptionTime), I suggest the following code:
I correct the use of residual connection, use a convolution for the bottleneck layer and remove the use of an initial linear layer. Best regards, (PS: I can push this modification ;)) |
Hey, thanks @charlotte-pel . ok I understand. So we should also change the default behavior of residual to false? (as we had before, but without any real implementation for residual=True) Also, from looking over the code: It seems that we shouldn't use the shortcut layer at every layer (as in the current implementation) just when Maybe we can move more tweaks in the implementation into a pull request rather than an issue. May be easier to compare/test and run codes there. Edit:
I guess the confusion originates from the different descriptions in the paper (every layer shortcutted) with the implementation (every third layer shortcutted). I suppose we stay with the implementation rather than the paper description? |
Hi @MarcCoru, I would let a default behavior to residual=True as it is use by default in InceptionTime. Regarding the residual connection, you are correct: there is a shortcut every third layer. Sorry the paper is not that clear, the definition of a residual block is given earlier p5-6
So every residual block is shortcutted, but a residual block is composed of three Inception modules. Hope it makes more sens now. I will do the pull request. All the best, |
We pulled in @charlotte-pel's code in a different pull request #31 . |
I tested all 7 model in ./breizhcrops/models with same datasets in 4 classes and processing it with same code, InceptionTime model classify them to only one class, but others six models works fine.
However, after changing InceptionTime.py, line 45
TO
the result seem reasonable, all 4 classes are classified with high precision.
Do I have to uncomment line 36~38 to use residual?
The code I used to processing the datasets, fit the model and classify raster:
https://gist.github.com/GenghisYoung233/834909ced3531e57b8ec6e0353d17c27
The text was updated successfully, but these errors were encountered: