@@ -39,7 +39,6 @@ def make_kernel_circle(r, k_sz, weight, kernel):
39
39
kernel [var + dx , var + dy ] = weight
40
40
41
41
42
-
43
42
def read_csv_line (f ):
44
43
line = f .readline ()
45
44
if not f :
@@ -55,7 +54,7 @@ def send_spikes(width, height, min_x, min_y, run_time, label, connection):
55
54
start_time = None
56
55
max_x = min_x + width
57
56
max_y = min_y + height
58
- y_shift = get_n_bits (width )
57
+ # y_shift = get_n_bits(width)
59
58
with open ("spikes.csv" ) as f :
60
59
first_time = - 1
61
60
line = read_csv_line (f )
@@ -71,9 +70,9 @@ def send_spikes(width, height, min_x, min_y, run_time, label, connection):
71
70
line = next_line
72
71
73
72
filtered_lines = [
74
- l for l in same_time_lines
75
- if (l .x >= min_x and l .x < max_x and l . y >= min_y and
76
- l .y < max_y )]
73
+ line for line in same_time_lines
74
+ if (line .x >= min_x and line .x < max_x and
75
+ line . y >= min_y and line .y < max_y )]
77
76
78
77
if not filtered_lines :
79
78
continue
@@ -161,11 +160,13 @@ def recv_conv(label, time, spikes):
161
160
162
161
163
162
conn = p .external_devices .SpynnakerLiveSpikesConnection (
164
- receive_labels = [SEND_POP_LABEL , POP_LABEL ], send_labels = [SEND_POP_LABEL ], local_port = None )
163
+ receive_labels = [SEND_POP_LABEL , POP_LABEL ], send_labels = [SEND_POP_LABEL ],
164
+ local_port = None )
165
165
conn .add_receive_callback (SEND_POP_LABEL , recv )
166
166
conn .add_receive_callback (POP_LABEL , recv_conv )
167
167
conn .add_start_callback (
168
- SEND_POP_LABEL , partial (send_spikes , WIDTH , HEIGHT , MIN_X , MIN_Y , RUN_TIME / 1000.0 ))
168
+ SEND_POP_LABEL , partial (
169
+ send_spikes , WIDTH , HEIGHT , MIN_X , MIN_Y , RUN_TIME / 1000.0 ))
169
170
170
171
171
172
p .setup (1.0 )
0 commit comments