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

A hyperparameter in a lambda layer #14241

Closed
Morz114114 opened this issue Oct 10, 2020 · 1 comment
Closed

A hyperparameter in a lambda layer #14241

Morz114114 opened this issue Oct 10, 2020 · 1 comment
Assignees
Labels
type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited.

Comments

@Morz114114
Copy link

Morz114114 commented Oct 10, 2020

I'm implementing a custom lambda layer in Keras. According to my guide, it should take in the previous variable (x) and multiply it with a learning rate.
y2= Lambda(lambda x: x/lr)(y1)
But this way, it need the lr to be specified ahead of time:
lr=0.2
y2= Lambda(lambda x: x/lr)(y1)
But what I need is something that take in the lr as a parameter which variable in each iteration, something like the following code:

y2= Lambda(lambda x: x/lr)(y1)
...
lr=1
for i in range(epochs):
lr=lr/1.0001
loss=Model.tain_on_batch(.....)

that means I need the lr not to be specified as a fixed parameter so that it can change over time. Any help?

@Morz114114 Morz114114 changed the title Shifting a hyperparameter in a lambda layer A hyperparameter in a lambda layer Oct 12, 2020
@saikumarchalla saikumarchalla added the type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited. label Oct 13, 2020
@sushreebarsa sushreebarsa self-assigned this Jul 7, 2021
@sushreebarsa
Copy link
Collaborator

@Morz114114 Moving this issue to closed status as there has been no recent activity, in case you still face the error please create a new issue.Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited.
Projects
None yet
Development

No branches or pull requests

3 participants