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

Allow slayer norms to use parameters #301

Closed
Gavinator98 opened this issue Apr 15, 2024 · 2 comments
Closed

Allow slayer norms to use parameters #301

Gavinator98 opened this issue Apr 15, 2024 · 2 comments
Assignees
Labels
1-feature New feature or request

Comments

@Gavinator98
Copy link

User story

As a user, I want to modify the arguments to slayer neuron norms.
The neuron norms provide arguments to adjust momentum and other parameters:

def __init__(self, num_features=None, momentum=0.1, pre_hook_fx=None):

However, when used the neuron calls the constructor with no arguments:

As a workaround it might be possible to use a lambda function as the norm argument:

params = {
    "norm": lambda x: slayer.neuron.norm.MeanOnlyBatchNorm(momentum=0.2)
}
@Gavinator98 Gavinator98 added the 1-feature New feature or request label Apr 15, 2024
@PhilippPlank
Copy link
Contributor

Thank you for this suggestion. @bamsumit Could you take a look, when you find some time :)

@bamsumit
Copy link
Contributor

@Gavinator98 The intended usage pattern is to call a lambda like you mention. This is by design because the norm could have other signatures and therefore cannot be known in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants