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

Support All keras activations functions #1244

Merged
merged 4 commits into from
Jan 29, 2025
Merged

Support All keras activations functions #1244

merged 4 commits into from
Jan 29, 2025

Conversation

EmilHvitfeldt
Copy link
Member

@EmilHvitfeldt EmilHvitfeldt commented Jan 29, 2025

Follows the style as seen in tidymodels/brulee@88d6002#diff-c28a6671db86faf0c62ceedbd8e305dff10d29d4ebe346e02877b429ee4eacbc

To close #1127

library(tidymodels)

model <- 
  mlp(activation = "selu") %>%
  set_engine("keras") %>%
  set_mode("classification")


fit(model, class ~ ., sim_classification(1000))
#> parsnip model object
#> 
#> Model: "sequential"
#> ________________________________________________________________________________
#>  Layer (type)                       Output Shape                    Param #     
#> ================================================================================
#>  dense (Dense)                      (None, 5)                       80          
#>  dense_1 (Dense)                    (None, 2)                       12          
#> ================================================================================
#> Total params: 92 (368.00 Byte)
#> Trainable params: 92 (368.00 Byte)
#> Non-trainable params: 0 (0.00 Byte)
#> ________________________________________________________________________________

@EmilHvitfeldt EmilHvitfeldt requested a review from topepo January 29, 2025 17:37
@EmilHvitfeldt
Copy link
Member Author

only failure is Failure ('test-fit_interfaces.R:168:3'): overhead of parsnip interface is minimal (#1071) ──

Copy link
Member

@topepo topepo left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good. I added some tests.

Can you go over to dials and update the valid activation list to include these and the ones from brulee?

@topepo topepo merged commit 556c732 into main Jan 29, 2025
10 checks passed
@topepo topepo deleted the all-keras-activations branch January 29, 2025 18:53
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to use SELU for the activation layer in mlp via keras
2 participants