From 8e8354e65e83089fe41430ecc725c891b794d165 Mon Sep 17 00:00:00 2001 From: Thomas Nowotny Date: Mon, 10 May 2021 16:40:49 +0100 Subject: [PATCH] Changed experiment 5 (exp5.py) to now consider covariance capped above 0 from below. --- src/exp5.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/exp5.py b/src/exp5.py index 96ac91b..fabd954 100644 --- a/src/exp5.py +++ b/src/exp5.py @@ -31,8 +31,8 @@ paras["lns_pns_g"]= 0 paras["lns_lns_g"]= 0 else: - paras["lns_pns_g"]*= 0.1*np.power(np.sqrt(10),ino) - paras["lns_lns_g"]*= 0.1*np.power(np.sqrt(10),ino) + paras["lns_pns_g"]*= np.power(np.sqrt(10),ino) + paras["lns_lns_g"]*= np.power(np.sqrt(10),ino) # write results into a dir with current date in the name timestr = time.strftime("%Y-%m-%d") @@ -106,8 +106,8 @@ odors= np.load(paras["dirname"]+"/"+label+"_odors.npy") oNo= odors.shape[0] -correl= np.corrcoef(odors,rowvar=False) -correl= correl/2.0+1.0 +correl= np.cov(odors,rowvar=False) +correl= np.maximum(0.0, correl) for i in range(paras["n_glo"]): correl[i,i]= 0.0