To generate connection files from the CSNN binary files.
----------
NOTE: For each layer you need to call the function separately.
----------
Parameters
----------
Authors Note: It is recommended to call the function with Transpoed=False and transpose the input before passing it to the SpikeSourceArray in PyNN.
-----
Input_CSNN_Binary_Files: Python list of binary file names (different binary files from the same layer)
ConnectionFile_Names: Python list of output file names (as text files compatible with PyNN FromFileConnector)
Input_size: Number of the neurons as the input of the layer
Output_size: Number of the neurons as the output of the layer
n_samples_to_plot: You can plot n_samples_to_plot weights between one input and all the output as plot
Non_Zero: If set to True, the weights with zero values will be removed from the output file.
Transpoed: Since CSNN binary file for the trained weights is transposed, is set Transpoed to True, the function will transpose the weights before generating the output file.
Inpute_shape: Python dictionary of shape of the input samples
defconvert_to_latency_code_V4(input_data,tarnsposed=True,samples_intervel=5,time_step=5,num_steps=10):# for CSNN simulation since exracted weights are transposed
print(f'Connection list from Inhibatory_Pop_{inh_pop_number} to Exctatory_Pop_{inh_pop_number} = {INH_POP_SIZE[inh_pop_number]}*{EXC_POP_SIZE[inh_pop_number]}')
print(f'Porjection from Excitatory pop_{inh_pop_number} ot Inhibatory pop_{inh_pop_number} is created')
print(f'Connecting ONE SHUT Inhibatory_Pop_{inh_pop_number} to all Exctatory_Pop_{inh_pop_number} = {INH_POP_SIZE[inh_pop_number]}*{EXC_POP_SIZE[inh_pop_number]}')