Example #1
0
        return out    
    elif t < 1.75 and TARGET:
        out += np.array([1.,.5])
    elif t > .125  and MASK:
        out += np.array([.5,1.])

    return out

def stimfunc(STIM,t,nt,MASK = True,TARGET = True):
    if STIM == 1:
        return np.array([S1(T,MASK,TARGET) for T in np.linspace(0,t,nt)])
    elif STIM == 2:
        return np.array([S2(T,MASK,TARGET) for T in np.linspace(0,t,nt)])
    elif STIM == 3:
        return np.array([S3(T,MASK,TARGET) for T in np.linspace(0,t,nt)])

nta = 80
tot = .4
ta = tot/(nta)
Fa = np.exp(-ta)*np.identity(2)    

stima = np.array([10*stimfunc(s,.4,nta + 1,MASK = M[1],TARGET = M[0])[:k] for k in range(1,81,5) for s in [1,2,3] for M in [[True,False],[False,True],[True,True]]])
stimp = np.array([10*stimfunc(s,.4,nta + 1,MASK = M[1],TARGET = M[0]) for s in [1,2,3] for M in [[True,False],[False,True],[True,True]]])

cor = [.1]

resp = np.array([inference.att_gexp(0,np.array([s]),cov(c),cov(0),inference.Q_self_con(cov(c),Fa),Fa) for c in cor for s in stima])

np.savetxt("./att_2d_resp.csv",resp)
np.savetxt("./att_2d_stim.csv",np.reshape(stimp,[-1,2]))
Example #2
0
import numpy as np
import GSM.MGSM_inference as MGSM

cov = np.array([[1, .1], [.1, 1]])
ncov = np.array([[1, 0], [0, 1]])
qcov = np.array([[.01, 0], [0, .01]])

print("cov", cov)
print("ncov", ncov)
print("qcov", qcov)

ff = np.array([[1, 0], [1, 1]])

res = MGSM.att_gexp(0, ff, ff, cov, ncov, qcov)
print(res)
Example #3
0
                                0,
                                16,
                                0,
                                5 * 16,
                                int(np.max(np.linalg.norm(sites, axis=1))),
                                get_grat=True)

    inp = np.array([get_grating_data(g, sites, RF) / fac for g in grat])

    nc = CNS
    f = .5 * np.identity(len(CNS))
    q = inf.Q_self_con(CNS, f)

    inp += np.random.multivariate_normal(np.zeros_like(inp[0]), nc, len(inp))

    aI = np.tile(np.expand_dims(inp, 1), [1, 3, 1])

    resp = inf.gnn(inp, CNS)
    iresp = inf.att_gexp(0, aI, CNS, nc, q, f)

    f = .75 * np.identity(len(CNS))
    q = inf.Q_self_con(CNS, f)

    aresp = inf.att_gexp(0, aI, CNS, nc, q, f)

    print(oris)

    np.savetxt("./random_gsm_resp.csv", resp)
    np.savetxt("./a_random_gsm_resp.csv", aresp)
    np.savetxt("./i_random_gsm_resp.csv", iresp)