synapses[connName].delay = rand() * delay['ee_input'] synapses[connName].w = weightMatrix.flatten() #------------------------------------------------------------------------------ # run the simulation and set inputs #------------------------------------------------------------------------------ fig_num = 1 input_weight_monitor, fig_weights = plot_2d_input_weights() #fig_num += 1 input_groups['Xe'].rates = 0 * Hz defaultclock.dt = 0.5 * ms run(0 * second) j = 0 while j < 5: normalize_weights() input_groups['Xe'].rates = training['x'][0, :, :].reshape( (n_input)) / 8. * 2. * Hz run(single_example_time) update_2d_input_weights(input_weight_monitor, fig_weights) input_groups['Xe'].rates = 0 * Hz run(resting_time) j += 1 b.ioff() b.show()
# The code seems to fail at the following step (NotImplementedError: Do not know how to plot object of type <class 'brian2.core.variables.VariableView'>) brian_plot(connections['XeAe'].w) subplot(3,1,2) brian_plot(connections['AeAi'].w) subplot(3,1,3) brian_plot(connections['AiAe'].w) plt.figure(6) subplot(3,1,1) brian_plot(connections['XeAe'].delay) subplot(3,1,2) brian_plot(connections['AeAi'].delay) subplot(3,1,3) brian_plot(connections['AiAe'].delay) b2.ioff() b2.show()
brian_plot(connections['XeAe'].w) subplot(3,1,2) brian_plot(connections['AeAi'].w) subplot(3,1,3) brian_plot(connections['AiAe'].w) plt.figure(6) subplot(3,1,1) brian_plot(connections['XeAe'].delay) subplot(3,1,2) brian_plot(connections['AeAi'].delay) subplot(3,1,3) brian_plot(connections['AiAe'].delay) b2.ioff() b2.show()