-
Notifications
You must be signed in to change notification settings - Fork 53
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
Add Mish class inheriting from Lamda layer #57
Conversation
tf2_yolov4/layers.py
Outdated
|
||
return x | ||
|
||
|
||
class Mish(Lambda): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lmontier je comprends pas à quoi sert cette classe: c'est la même chose que Lambda(function=tfa.activations.mish)
et elle ne sert qu'une seule fois.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AntoineToubhans je crois que c'est pour qu'elle apparaisse de manière plus friendly dans le plot_model
de Keras, mais je suis pas hyper chaud pour merger non plus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AntoineToubhans @RaphaelMeudec , ça fait deux choses :
- On mélange des keras.layer et des keras.functions dans nos models, ce qui fait que notamment la function plot_model de keras crash (mais je me dis que peut être d'autres utilis peuvent péter également...). Il me semble que Clément nous avais également indiqué ce genre de retour. D'où le Lambda(function=tfa.activations.mish) ou le Mish()
- Utiliser Lambda(function=tfa.activations.mish) fait que quand tu examines ton modèle (ou que tu le plot), le nom de tes layers s'appellent "Lambda_x" , alors que si tu redéfinis une classe "Mish", ils s'appelleront "Mish_x"... C'est assez chiant car on utilise ailleurs d'autre Lambda... J'ai essayé de faire autrement, genre forcer le name=... mais pour ça il faut avoir accès à ton index du layer et je n'ai pas réussi. Si vous savez comment faire ça par contre je suis chaud!
Closing this PR as it will be integrated with #60 along with the TFLite converter |
No description provided.