示例#1
0
def compute_fig5_data(model_class=Model, δ_J_stim=(1, 1),
                      δ_J_nmda=(1, 1), δ_J_gaba=(1, 1, 1), desc=''):
    """Compute the data for Figure 5."""
    model = model_class(n=n, ΔA=ΔA, ΔB=ΔB, random_seed=1,
                        δ_J_stim=δ_J_stim, δ_J_gaba=δ_J_gaba, δ_J_nmda=δ_J_nmda)

    filename='data/fig5_{}[{}]{}.pickle'.format(desc, n, model.desc)
    run_model(model, offers, history_keys=(), filename=filename)
示例#2
0
    def compute_fig4_data(model_class=Model):
        model = model_class(n=n, ΔA=ΔA, ΔB=ΔB, random_seed=1)

        filename = 'data/fig4[{}]{}.pickle'.format(n, model.desc)
        return run_model(model,
                         offers,
                         history_keys=('r_ovb', 'r_2', 'r_I'),
                         smooth=smooth,
                         filename=filename)
示例#3
0
def compute_fig7_data(model_class=Model, w_p=1.82):
    model = model_class(n=n,
                        ΔA=ΔA,
                        ΔB=ΔB,
                        random_seed=1,
                        w_p=1.82,
                        hysteresis=True)

    filename = 'data/fig7_{}[{}]{}.pickle'.format(w_p, n, model.desc)
    return run_model(model, offers, history_keys=('r_2', ), filename=filename)
示例#4
0
def compute_fig4_data(model_class=Model):
    """Compute the Figure 4 data used in the Figure_4 notebook.

    If the result filename already exists, the computation will be skipped.
    :param model_class:  set to ReplicatedModel if you want to replicate the published figures.
                         set to Model to use the 'corrected' model, as described in the article.
    """
    model = model_class(n=n, random_seed=1, ΔA=ΔA, ΔB=ΔB)

    filename='data/fig4[{}]{}.pickle'.format(n, model.desc)
    return run_model(model, offers, history_keys=('r_ovb', 'r_2', 'r_I'), filename=filename)
示例#5
0
def compute_fig10_data(model_class=Model, network='symmetric'):
    δ_J_stim = {'symmetric':  (1  , 1),
                'asymmetric': (1.2, 1)}[network]

    model = model_class(n=n, ΔA=ΔA, ΔB=ΔB, random_seed=1,
                        r_o=6, w_p=1.65, J_ampa_rec_in=J_ampa_rec_in,
                        J_nmda_rec_in=J_nmda_rec_in, J_gaba_rec_in=J_gaba_rec_in,
                        δ_J_stim=δ_J_stim)

    filename = 'data/fig10_{}[{}]{}.pickle'.format(network, n, model.desc)
    return run_model(model, offers, history_keys=('r_ovb', 'r_2', 'r_I'), filename=filename)
示例#6
0
def compute_fig9_data(model_class, w_p=1.75, ΔJ=30):
    """
    If the result filename already exists, the computation will be skipped.
    :param model_class:  set to ReplicatedModel if you want to replicate the published figures.
                         set to Model to use the 'corrected' model, as described in the article.
    """
    model = model_class(n=n,
                        ΔA=ΔA,
                        ΔB=ΔB,
                        random_seed=1,
                        δ_J_stim=(1, 1),
                        w_p=w_p,
                        ΔJ=ΔJ)
    filename = 'data/fig9_{}_{}[{}]{}.pickle'.format(w_p, ΔJ, n, model.desc)
    return run_model(model,
                     offers,
                     history_keys=('r_1', 'r_2'),
                     filename=filename,
                     preprocess=False)
示例#7
0
    def compute_fig6_data(model_class, w_p):
        model = model_class(n=n, ΔA=ΔA, ΔB=ΔB, random_seed=1, w_p=w_p)

        filename = 'data/fig6_{}[{}]{}.pickle'.format(w_p, n, model.desc)
        return run_model(model, offers, history_keys=('r_2', 'r_I'),
                         smooth=smooth, filename=filename)