Beispiel #1
0
def plot_2d_input_weights():
    name = 'XeAe'
    weights = get_2d_input_weights()
    fig = b2.figure(fig_num, figsize = (18, 18))
    im2 = b2.imshow(weights, interpolation = "nearest", vmin = 0, vmax = wmax_ee, cmap = cmap.get_cmap('hot_r'))
    b2.colorbar(im2)
    b2.title('weights of connection' + name)
    fig.canvas.draw()
    return im2, fig
def plot_2d_input_weights():
    name = 'XeAe'
    weights = get_2d_input_weights()
    fig = b2.figure(fig_num, figsize = (18, 18))
    im2 = b2.imshow(weights, interpolation = "nearest", vmin = 0, vmax = wmax_ee, cmap = cmap.get_cmap('hot_r'))
    b2.colorbar(im2)
    b2.title('weights of connection' + name)
    fig.canvas.draw()
    return im2, fig
                                                  range=(0., 1.))[0]

    weights_mu = b2.array(synapse_mu.w)
    mu_weight_histograms = b2.empty((N_bins, N_out))
    for i in range(N_out):
        # brian2 uses i->j synapse syntax, while I use j->i
        mask = synapse_mu.j == i
        mu_weight_histograms[:, i] = np.histogram(weights_mu[mask] / w_max,
                                                  bins=N_bins,
                                                  density=True,
                                                  range=(0., 1.))[0]

    b2.figure(figsize=(4, 4))
    im = b2.imshow(
        rates_weight_histograms,
        origin='lower',
        extent=[postsyn_rates[0] / b2.Hz, postsyn_rates[-1] / b2.Hz, 0, 1],
        aspect='auto',
        cmap=b2.plt.cm.gray_r)
    # b2.colorbar(label='probability density')
    b2.xlabel("Postsynaptic Firing Rate (Hz)")
    # b2.ylabel(r"$\frac{w}{w_{max}}$", rotation=0)
    b2.ylabel("$w/w_{max}$")
    b2.title(
        'Synaptic Strength Distributions\nas function of postsynaptic firing rate'
    )
    b2.savefig('images_and_animations/synaptic_strengths_vs_firing_rates.png')
    # b2.show()

    b2.figure(figsize=(4, 4))
    im = b2.imshow(mu_weight_histograms,
                   origin='lower',