Hi @mstimberg , I have the following code using the delete function but the number of files still keep on increasing. Majority of the files are in ‘cpp_standalone0/static_arrays’. Could it be that I didn’t use it correctly and Is there a way to check this further?
for stimulus_idx, (img, label) in enumerate(tqdm_ray.tqdm(data_in)):
switch_stimulus = False
stimulus_strength = input_param.scale_img # starting strength
self.repetitions = 0 # num of repetitions for one sample
while switch_stimulus == False:
scaled_img = img*stimulus_strength
arguments = {
self.input_neurons.rate: scaled_img*brian2.Hz,
self.input_neurons.label: label,
self.input_neurons.stimulus_idx: stimulus_idx,
self.input_neurons.stimulus_strength:stimulus_strength,
}
for ih in range(self.N_hidden):
arguments.update({
self.exci_neurons[ih].stimulus_idx: stimulus_idx,
self.exci_neurons[ih].stimulus_strength: stimulus_strength,
self.exci_neurons[ih].label: label,
})
if label!=-1: # skip the fake stimulus
arguments.update({self.exci_neurons[ih].vt: vt[ih][:]})
if self.task == 'train':
for ih in range(len(self.S_input2e)):
arguments.update({
self.S_input2e[ih].w: S_input2e_w[ih][:],
})
for i in range(len(self.S_efe)):
for j in range(len(self.S_efe[i])):
arguments.update({
self.S_efe[i][j].w: S_efe_w[i][j][:],
})
for i in range(len(self.S_efe_TopDown)):
for j in range(len(self.S_efe_TopDown[i])):
arguments.update({
self.S_efe_TopDown[i][j].w: S_efe_TopDown_w[i][j][:],
})
for ih in range(len(self.S_e2e_exci)):
arguments.update({
self.S_e2e_exci[ih].w: S_e2e_exci_w[ih][:],
})
for ih in range(len(self.S_e2e_exci_TopDown)):
arguments.update({
self.S_e2e_exci_TopDown[ih].w: S_e2e_exci_TopDown_w[ih][:],
})
brian2.device.run(run_args=arguments, with_output=False) # process the sample
for ih in range(self.N_hidden):
vt[ih] = self.exci_neurons[ih].vt[:]
# delete large arraies from the last stimulus to avoid too many files when running last number of samples
brian2.device.delete(code=False, directory=False)
Please see the attachment in following rely for the list of files in “static_array”.