From 8fded1a8f1d4fa9987387ddaf6b7fb47b38941cc Mon Sep 17 00:00:00 2001 From: fangwei123456 Date: Sat, 11 Sep 2021 17:25:34 +0800 Subject: [PATCH] for some unknown reasons, using 'cupy' will not make network converge. This problem should be fixed, --- spikingjelly/clock_driven/examples/speechcommands.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spikingjelly/clock_driven/examples/speechcommands.py b/spikingjelly/clock_driven/examples/speechcommands.py index 59d14750..90839d56 100644 --- a/spikingjelly/clock_driven/examples/speechcommands.py +++ b/spikingjelly/clock_driven/examples/speechcommands.py @@ -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)