Exemplo n.º 1
0
def main() :
    N = 20
    K = 2
    W = np.random.rand(N,N,K)
    A = W.copy()
    for k in range(K) : 
        A[:,:,k] = np.linalg.pinv(W[:,:,k])
    
    print "This should come out to zero \n", isi.joint_ISI(W,A)
    
    A = np.random.rand(N,N,K)
    print "Who knows what this should come out to \n", isi.joint_ISI(W,A)
Exemplo n.º 2
0
def main():
    N = 20
    K = 2
    W = np.random.rand(N, N, K)
    A = W.copy()
    for k in range(K):
        A[:, :, k] = np.linalg.pinv(W[:, :, k])

    print "This should come out to zero \n", isi.joint_ISI(W, A)

    A = np.random.rand(N, N, K)
    print "Who knows what this should come out to \n", isi.joint_ISI(W, A)
Exemplo n.º 3
0
def test1_2 (fil1, fil2, number) :
    K=10
    variables = loadmat(fil1)
    A = np.zeros((16,16,K))
    for k in range(K) :
        A[:,:,k] = variables['A'][0,k]
    
    variables = loadmat(fil2)
    X = np.zeros((16,32968,K))
    for k in range(K) :
        X[:,:,k] = np.dot(A[:,:,k], variables['Sgt'][0,k][:,:])
    
    fil = open("test_SCV_r0%i_FA.csv"%number, "w")
    fil.write("Iteration,ISI\n")
    fil2 = open("temp_ISI.txt", "w")
    X_values = []
    ISI_values = []
    
    for k in range(2, K) :
        W,_,_ = iva_l(X[:,:,0:k], verbose=True)
        
        isi = joint_ISI(W,A[:,:,0:k])
        print isi
        
        fil.write("%i,%f\n"%(k,isi))
        fil2.write("%i"%isi)
        
        X_values.append(k)
        ISI_values.append(isi)
   
    fil.close()
    fil2.close()
    plt.plot(X_values, ISI_values)
    plt.title("ISI Value by Number of total Subjects")
    plt.xlabel("Number of Subjects")
    plt.ylabel("ISI Value")
    plt.savefig("normal_IVA_r0%i.pdf"%number)
    plt.close("all")