Skip to content
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

Added Mish Activation Function #173

Merged
merged 3 commits into from
Aug 4, 2021
Merged

Conversation

digantamisra98
Copy link
Contributor

@digantamisra98 digantamisra98 commented Jul 30, 2021

Resolves 168 and adds Mish Activation Function.

  • Implementation of activation class named as MishActivation
  • Documentation of activation function
  • JUnit tests in api module
  • Support for export of activation function to JSON (see ModelSaver.kt)
  • Support for import of activation function from JSON (see ModelLoader.kt)

@digantamisra98
Copy link
Contributor Author

@zaleslaw This is ready for review.

@zaleslaw zaleslaw added the LGTM PR reviewed and is ready to merge label Aug 3, 2021
@zaleslaw
Copy link
Collaborator

zaleslaw commented Aug 3, 2021

Many thanks for the contribution, @digantamisra98 I'll run the TC and merge it if it is successful

@@ -215,6 +215,26 @@ public enum class Activations {
*/
Swish;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

; -> , due to enum in Kotlin https://kotlinlang.org/docs/enum-classes.html

Copy link
Collaborator

@zaleslaw zaleslaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you compile the Kotlin code or just added rows in the Notepad++? Because the code could not be compiled on TC servers

  > Task :api:compileKotlin
13:45:25   :api:compileKotlin
13:45:47     e: /mnt/agent/work/c1e3495e9fda7093/api/src/main/kotlin/org/jetbrains/kotlinx/dl/api/core/activation/Activations.kt: (234, 5): Expecting member declaration
13:45:47     e: /mnt/agent/work/c1e3495e9fda7093/api/src/main/kotlin/org/jetbrains/kotlinx/dl/api/core/activation/Activations.kt: (234, 5): Expecting member declaration
13:45:47     e: /mnt/agent/work/c1e3495e9fda7093/api/src/main/kotlin/org/jetbrains/kotlinx/dl/api/core/activation/Activations.kt: (258, 17): Unresolved reference: Mish
13:45:47     e: /mnt/agent/work/c1e3495e9fda7093/api/src/main/kotlin/org/jetbrains/kotlinx/dl/api/core/activation/Activations.kt: (258, 17): Unresolved reference: Mish
13:45:47     e: /mnt/agent/work/c1e3495e9fda7093/api/src/main/kotlin/org/jetbrains/kotlinx/dl/api/inference/keras/ModelLoader.kt: (430, 9): Unresolved reference: ACTIVATION_MISH
13:45:47     e: /mnt/agent/work/c1e3495e9fda7093/api/src/main/kotlin/org/jetbrains/kotlinx/dl/api/inference/keras/ModelLoader.kt: (430, 40): Unresolved reference: Mish
13:45:47     e: /mnt/agent/work/c1e3495e9fda7093/api/src/main/kotlin/org/jetbrains/kotlinx/dl/api/inference/keras/ModelSaver.kt: (270, 21): Unresolved reference: Mish
13:45:47     e: /mnt/agent/work/c1e3495e9fda7093/api/src/main/kotlin/org/jetbrains/kotlinx/dl/api/inference/keras/ModelLoader.kt: (430, 9): Unresolved reference: ACTIVATION_MISH
13:45:47     e: /mnt/agent/work/c1e3495e9fda7093/api/src/main/kotlin/org/jetbrains/kotlinx/dl/api/inference/keras/ModelSaver.kt: (270, 29): Unresolved reference: ACTIVATION_MISH
13:45:47     
13:45:47     e: /mnt/agent/work/c1e3495e9fda7093/api/src/main/kotlin/org/jetbrains/kotlinx/dl/api/inference/keras/ModelLoader.kt: (430, 40): Unresolved reference: Mish
13:45:47     e: /mnt/agent/work/c1e3495e9fda7093/api/src/main/kotlin/org/jetbrains/kotlinx/dl/api/inference/keras/ModelSaver.kt: (270, 21): Unresolved reference: Mish
13:45:47     e: /mnt/agent/work/c1e3495e9fda7093/api/src/main/kotlin/org/jetbrains/kotlinx/dl/api/inference/keras/ModelSaver.kt: (270, 29): Unresolved reference: ACTIVATION_MISH
13:45:47   > Task :api:compileKotlin FAILED

@zaleslaw zaleslaw added Review This PR is under review and removed LGTM PR reviewed and is ready to merge labels Aug 3, 2021
@zaleslaw
Copy link
Collaborator

zaleslaw commented Aug 3, 2021

:api:compileKotlin
18:15:27     e: /mnt/agent/work/c1e3495e9fda7093/api/src/main/kotlin/org/jetbrains/kotlinx/dl/api/inference/keras/ModelLoader.kt: (430, 9): Unresolved reference: ACTIVATION_MISH
18:15:27     e: /mnt/agent/work/c1e3495e9fda7093/api/src/main/kotlin/org/jetbrains/kotlinx/dl/api/inference/keras/ModelSaver.kt: (270, 29): Unresolved reference: ACTIVATION_MISH
18:15:27     
18:15:27     e: /mnt/agent/work/c1e3495e9fda7093/api/src/main/kotlin/org/jetbrains/kotlinx/dl/api/inference/keras/ModelLoader.kt: (430, 9): Unresolved reference: ACTIVATION_MISH
18:15:27     e: /mnt/agent/work/c1e3495e9fda7093/api/src/main/kotlin/org/jetbrains/kotlinx/dl/api/inference/keras/ModelSaver.kt: (270, 29): Unresolved reference: ACTIVATION_MISH

Not compiled again, ok, I'll help to finish this request, clone your branch tomorrow and resolve the issue.

@mkaze
Copy link
Contributor

mkaze commented Aug 3, 2021

@digantamisra98 Just add the following line to the KerasConstants.kt file:

internal const val ACTIVATION_MISH: String = "mish"

@digantamisra98
Copy link
Contributor Author

@mkaze Done, thanks. Had missed that out.

@zaleslaw Fixed the issues and yes I had just edited/ added the files in an IDE, I didn't build it locally. I hope it compiles now.

@zaleslaw zaleslaw merged commit 909cfe9 into Kotlin:master Aug 4, 2021
@zaleslaw
Copy link
Collaborator

zaleslaw commented Aug 4, 2021

Thanks, @digantamisra98, for the contribution and @mkaze for the advice!
Good luck with ML science, and we will wait for new papers and results which could be implemented in DL frameworks and useful for the AutoML!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review This PR is under review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Mish activation function
3 participants