Skip to content

Commit

Permalink
for some unknown reasons, using 'cupy' will not make network converge…
Browse files Browse the repository at this point in the history
…. This problem should be fixed,
  • Loading branch information
fangwei123456 committed Sep 11, 2021
1 parent f35fa03 commit 8fded1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spikingjelly/clock_driven/examples/speechcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,17 +300,17 @@ def __init__(self):
# 101 * 40
nn.Conv2d(in_channels=delta_order+1, out_channels=64,
kernel_size=(4, 3), stride=1, padding=(2, 1), bias=False),
LIFWrapper(neuron.MultiStepLIFNode(tau=10.0 / 7, surrogate_function=surrogate.Sigmoid(alpha=10.), backend='cupy')),
LIFWrapper(neuron.MultiStepLIFNode(tau=10.0 / 7, surrogate_function=surrogate.Sigmoid(alpha=10.), backend='torch')),

# 102 * 40
nn.Conv2d(in_channels=64, out_channels=64,
kernel_size=(4, 3), stride=1, padding=(6, 3), dilation=(4, 3), bias=False),
LIFWrapper(neuron.MultiStepLIFNode(tau=10.0 / 7, surrogate_function=surrogate.Sigmoid(alpha=10.), backend='cupy')),
LIFWrapper(neuron.MultiStepLIFNode(tau=10.0 / 7, surrogate_function=surrogate.Sigmoid(alpha=10.), backend='torch')),

# 102 * 40
nn.Conv2d(in_channels=64, out_channels=64,
kernel_size=(4, 3), stride=1, padding=(24, 9), dilation=(16, 9), bias=False),
LIFWrapper(neuron.MultiStepLIFNode(tau=10.0 / 7, surrogate_function=surrogate.Sigmoid(alpha=10.), backend='cupy'), flatten=True),
LIFWrapper(neuron.MultiStepLIFNode(tau=10.0 / 7, surrogate_function=surrogate.Sigmoid(alpha=10.), backend='torch'), flatten=True),
)
# [batch size, T, channel * n_mel]
self.fc = nn.Linear(64 * 40, label_cnt)
Expand Down

0 comments on commit 8fded1a

Please sign in to comment.