hacked_digit[N_v:] = clamped_input_transform(cl,
                                                 min_p=1e-16,
                                                 max_p=.500 + .2e-9)

    Ids_demo = np.load('data/ids.npy')
    Ids = np.column_stack([
        create_single_Id(3, data, mult_class=0.0, mult_data=1.0) * 0,
        create_single_Id(3, data, mult_class=0.0, mult_data=1.0),
        create_single_Id(5, data, mult_class=1.0, mult_data=0.0),
        hacked_digit,
    ]).T

    Ids[-1, :N_v] = Ids_demo[-1, :N_v]
    Ids[1, :N_v] = Ids_demo[1, :N_v]

    out = main(W, b_v, b_c, b_h, Id=Ids)
    Mh, Mv, Mc = out['Mh'], out['Mv'], out['Mc']

    d = et.mksavedir()
    et.globaldata.Mc = Mc.spikes
    et.globaldata.Mv = Mv.spikes
    et.globaldata.Mh = Mh.spikes
    et.save()

    from plot_options import *
    pylab.ioff()

    bone()
    matplotlib.rcParams['figure.subplot.wspace'] = .0
    matplotlib.rcParams['figure.subplot.hspace'] = .0
    matplotlib.rcParams['figure.subplot.bottom'] = .0
Esempio n. 2
0
def wrap_run(Id):
    out = main(W, b_v, b_c, b_h, Id=np.array([Id]))
    Mh, Mv = out['Mh'], out['Mv']
    res = np.array(spike_histogram(Mv, t_sim / 2,
                                   t_sim)).T[1][:N_v].reshape(28, 28)
    return res
    cl[(3*n_c_unit):(4*n_c_unit)] = .98
    cl[(6*n_c_unit):(7*n_c_unit)] = .98
    hacked_digit[N_v:]= clamped_input_transform(cl, min_p = 1e-16, max_p = .500+.2e-9)

    Ids_demo = np.load('data/ids.npy')
    Ids = np.column_stack([
        create_single_Id(3,data,mult_class=0.0,mult_data=1.0)*0,
        create_single_Id(3,data,mult_class=0.0,mult_data=1.0),
        create_single_Id(5,data,mult_class=1.0,mult_data=0.0),
        hacked_digit,
        ]).T

    Ids[-1,:N_v] = Ids_demo[-1,:N_v]
    Ids[1,:N_v] = Ids_demo[1,:N_v]

    out = main(W, b_v, b_c, b_h, Id = Ids)
    Mh, Mv, Mc= out['Mh'], out['Mv'], out['Mc']



    d = et.mksavedir()
    et.globaldata.Mc = Mc.spikes
    et.globaldata.Mv = Mv.spikes
    et.globaldata.Mh = Mh.spikes
    et.save()
    
    from plot_options import *
    pylab.ioff()


    bone()
Esempio n. 4
0
def wrap_run(Id):
    out = main(W, b_v, b_c, b_h, Id = np.array([Id]))
    Mh, Mv= out['Mh'], out['Mv']
    res = np.array(spike_histogram(Mv,t_sim/2,t_sim)).T[1][:N_v].reshape(28,28)
    return res