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

feature requests for RNNs #2514

Open
1 of 6 tasks
CarloLucibello opened this issue Nov 4, 2024 · 4 comments
Open
1 of 6 tasks

feature requests for RNNs #2514

CarloLucibello opened this issue Nov 4, 2024 · 4 comments
Labels

Comments

@CarloLucibello
Copy link
Member

CarloLucibello commented Nov 4, 2024

After the redesign in #2500, here is a list of potential improvements for recurrent layers and recurrent cells

@MartinuzziFrancesco
Copy link
Contributor

Could it be possible to add to the list the option to use different initializers for the input matrix and recurrent matrix? This is provided by both Keras/TF and Flax.

This should be as straightforward as

function RNNCell((in, out)::Pair, σ=relu;
    kernel_init = glorot_uniform,
    recurrent_kernel_init = glorot_uniform,
    bias = true)
    Wi = kernel_init(out, in)
    U = recurrent_kernel_init(out, out)
    b = create_bias(Wi, bias, size(Wi, 1))
    return RNNCell(σ, Wi, U, b)
end

I can also open a quick PR on this if needed

@CarloLucibello
Copy link
Member Author

yes! PR welcome

@MartinuzziFrancesco
Copy link
Contributor

Following up on this, should we also have an option to choose the init for the bias?

@CarloLucibello
Copy link
Member Author

We don't do it for feedforward layers, if someone wants a non-zero bias can just change it manually in the constructor, layer.bias .= ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants