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

Bad default values for on_target and off_target in mse_membrane_loss #253

Open
saiftyfirst opened this issue Oct 15, 2023 · 0 comments
Open

Comments

@saiftyfirst
Copy link
Contributor

saiftyfirst commented Oct 15, 2023

mse_membrane_loss uses spikegen to convert a tensor of targets into a tensor of spikes. For example:

target = torch.tensor([2, 1, 0]) 
on_target = 1
off_target = 0
targets_spikes = spikegen.targets_convert(
        targets, num_classes=3 , on_target=on_target, off_target=off_target)

The problem
mse_membrane_loss defines member variables on_target and off_target by default with values of 0 and -1. This results in a target_spike tensor of all 0s (Try above example with the changed on_target and off_target values)

Code Reference / Cause
spikegen.py:1023
function: targets_rate(...)

if on_target > off_target:
                return torch.clamp(
                    to_one_hot(targets, num_classes) * on_target, off_target
                )
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