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

snntorch.surrogate.LSO returns StochasticSpikeOperator instead of LeakySpikeOperator #347

Open
TommyClausner opened this issue Sep 17, 2024 · 0 comments

Comments

@TommyClausner
Copy link

  • snntorch version: 0.9.1
  • Python version: 3.10
  • Operating System: linux

Description

I tried to use spike_grad = snntorch.surrogate.LSO(slope=0.1) with snntorch.Synaptic(alpha=alpha, beta=beta, spike_grad=spike_grad)

and got the error message:

TypeError: StochasticSpikeOperator.forward() missing 1 required positional argument: 'variance'

When checking the source I have seen that in snntorch.surrogate the following function might return the wrong value:

def LSO(slope=0.1):
    """Leaky spike operator gradient enclosed with a parameterized slope."""
    slope = slope

    def inner(x):
        return StochasticSpikeOperator.apply(x, slope)

    return inner

I think instead of returning StochasticSpikeOperator.apply(x, slope) it should return LeakySpikeOperator.apply(x, slope)

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

No branches or pull requests

1 participant