Skip to content

Commit

Permalink
Merge pull request #606 from 0xnurl/remove-unused-arg
Browse files Browse the repository at this point in the history
Remove unused argument `input_time_dim`
  • Loading branch information
Hananel-Hazan committed Dec 23, 2022
2 parents 31aaa40 + ff03b82 commit 8321825
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions examples/mnist/SOM_LM-SNNs.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
factor = 1.2
for retry in range(5):
# Run the network on the input.
network.run(inputs=inputs, time=time, input_time_dim=1)
network.run(inputs=inputs, time=time)

# Get spikes from the network
temp_spikes = spikes["Y"].get("s").squeeze()
Expand Down Expand Up @@ -348,7 +348,7 @@
inputs = {k: v.cuda() for k, v in inputs.items()}

# Run the network on the input.
network.run(inputs=inputs, time=time, input_time_dim=1)
network.run(inputs=inputs, time=time)

# Add to spikes recording.
spike_record[0] = spikes["Y"].get("s").squeeze()
Expand Down
4 changes: 2 additions & 2 deletions examples/mnist/batch_eth_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
labels.extend(batch["label"].tolist())

# Run the network on the input.
network.run(inputs=inputs, time=time, input_time_dim=1)
network.run(inputs=inputs, time=time)

# Add to spikes recording.
s = spikes["Ae"].get("s").permute((1, 0, 2))
Expand Down Expand Up @@ -343,7 +343,7 @@
inputs = {k: v.cuda() for k, v in inputs.items()}

# Run the network on the input.
network.run(inputs=inputs, time=time, input_time_dim=1)
network.run(inputs=inputs, time=time)

# Add to spikes recording.
spike_record = spikes["Ae"].get("s").permute((1, 0, 2))
Expand Down
2 changes: 1 addition & 1 deletion examples/mnist/conv1d_MNIST.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
label = batch["label"]

# Run the network on the input.
network.run(inputs=inputs, time=time, input_time_dim=1)
network.run(inputs=inputs, time=time)

network.reset_state_variables() # Reset state variables.

Expand Down
2 changes: 1 addition & 1 deletion examples/mnist/conv3d_MNIST.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
label = batch["label"]

# Run the network on the input.
network.run(inputs=inputs, time=time, input_time_dim=1)
network.run(inputs=inputs, time=time)

network.reset_state_variables() # Reset state variables.

Expand Down
2 changes: 1 addition & 1 deletion examples/mnist/conv_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
label = batch["label"]

# Run the network on the input.
network.run(inputs=inputs, time=time, input_time_dim=1)
network.run(inputs=inputs, time=time)

# Optionally plot various simulation information.
if plot and batch_size == 1:
Expand Down
4 changes: 2 additions & 2 deletions examples/mnist/eth_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
labels.append(batch["label"])

# Run the network on the input.
network.run(inputs=inputs, time=time, input_time_dim=1)
network.run(inputs=inputs, time=time)

# Get voltage recording.
exc_voltages = exc_voltage_monitor.get("v")
Expand Down Expand Up @@ -312,7 +312,7 @@
inputs = {k: v.cuda() for k, v in inputs.items()}

# Run the network on the input.
network.run(inputs=inputs, time=time, input_time_dim=1)
network.run(inputs=inputs, time=time)

# Add to spikes recording.
spike_record[0] = spikes["Ae"].get("s").squeeze()
Expand Down
2 changes: 1 addition & 1 deletion examples/mnist/loc1d_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
label = batch["label"]

# Run the network on the input.
network.run(inputs=inputs, time=time, input_time_dim=1)
network.run(inputs=inputs, time=time)

network.reset_state_variables() # Reset state variables.

Expand Down
2 changes: 1 addition & 1 deletion examples/mnist/loc2d_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
label = batch["label"]

# Run the network on the input.
network.run(inputs=inputs, time=time, input_time_dim=1)
network.run(inputs=inputs, time=time)

# Optionally plot various simulation information.
if plot:
Expand Down
2 changes: 1 addition & 1 deletion examples/mnist/loc3d_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
label = batch["label"]

# Run the network on the input.
network.run(inputs=inputs, time=time, input_time_dim=1)
network.run(inputs=inputs, time=time)


print("Progress: %d / %d (%.4f seconds)\n" % (n_epochs, n_epochs, t() - start))
Expand Down
4 changes: 2 additions & 2 deletions examples/mnist/reservoir.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
pbar.set_description_str("Train progress: (%d / %d)" % (i, n_iters))

# Run network on sample image
network.run(inputs={"I": datum}, time=time, input_time_dim=1)
network.run(inputs={"I": datum}, time=time)
training_pairs.append([spikes["O"].get("s").sum(0), label])

# Plot spiking activity using monitors
Expand Down Expand Up @@ -237,7 +237,7 @@ def forward(self, x):
label = dataPoint["label"]
pbar.set_description_str("Testing progress: (%d / %d)" % (i, n_iters))

network.run(inputs={"I": datum}, time=time, input_time_dim=1)
network.run(inputs={"I": datum}, time=time)
test_pairs.append([spikes["O"].get("s").sum(0), label])

if plot:
Expand Down
2 changes: 1 addition & 1 deletion examples/mnist/supervised_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
inputs = {k: v.cuda() for k, v in inputs.items()}

# Run the network on the input.
network.run(inputs=inputs, time=time, input_time_dim=1)
network.run(inputs=inputs, time=time)

# Add to spikes recording.
spike_record[0] = spikes["Ae"].get("s").squeeze()
Expand Down
2 changes: 1 addition & 1 deletion examples/tensorboard/tensorboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@

# Run the network on the input.
# Specify the location of the time dimension
network.run(inputs=inputs, time=time, input_time_dim=1)
network.run(inputs=inputs, time=time)

network.reset_state_variables() # Reset state variables.

Expand Down

0 comments on commit 8321825

Please sign in to comment.