Skip to content

Commit

Permalink
Try Shuffle_sim without G sweep
Browse files Browse the repository at this point in the history
  • Loading branch information
Spokhim committed Dec 14, 2020
1 parent 9db0b61 commit cf79ae4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Shuffle_sim.csh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#PBS -V

# -J Specifies Job Array with Indices
#PBS -J 1-200
#PBS -J 1-100

# Show the host on which the job ran
hostname
Expand Down
45 changes: 27 additions & 18 deletions Shuffle_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@
i = int(sys.argv[1])

# FCFC Shuffle
ParamsDict["ExportSim"] = False
# Skimp on computation time and power by reducing to 1.2e4. Should be fine.
# Nah don't save it.
ParamsDict["ExportSim"] = False
# Skimp on computation time and power by reducing to 1.2e5.
ParamsDict["Simul_length"] = 1.2e5

# First we must shuffle it randomly.
Expand Down Expand Up @@ -129,22 +130,24 @@
Best_G = 0
Best_Sigma = 0

# Do not sweep G
ParamsDict["G"] = 0.7

# Sweep across the range of Sigma values:
for I in np.arange(6):

ParamsDict["Sigma"] =I*0.2
sigma = ParamsDict["Sigma"]

# Heterogeneous Coupling Constants (array)
ParamsDict["MODEL_c_ie"] = h_ie * (1 + sigma * E_normalised)
ParamsDict["MODEL_c_ee"] = h_ee * (1 + sigma * E_normalised)
ParamsDict["MODEL_c_ii"] = h_ii * (1 + sigma * I_normalised)
ParamsDict["MODEL_c_ei"] = h_ei * (1 + sigma * I_normalised)
ParamsDict["Sigma_e"] =I*0.2
sigma_e = ParamsDict["Sigma_e"]


# Sweep across the range of G values
for J in np.arange(29):
ParamsDict["G"] = np.array([J * 0.05]) + 0.10
for J in np.arange(6):
ParamsDict["Sigma_i"] = J*0.2
sigma_i = ParamsDict["Sigma_i"]

# Heterogeneous Coupling Constants (array)
ParamsDict["MODEL_c_ie"] = h_ie * (1 + sigma_e * E_normalised)
ParamsDict["MODEL_c_ee"] = h_ee * (1 + sigma_e * E_normalised)
ParamsDict["MODEL_c_ii"] = h_ii * (1 + sigma_i * I_normalised)
ParamsDict["MODEL_c_ei"] = h_ei * (1 + sigma_i * I_normalised)

ParamsDict["MODEL"] = models.WilsonCowan(c_ee=ParamsDict["MODEL_c_ee"],c_ei=ParamsDict["MODEL_c_ei"],c_ie=ParamsDict["MODEL_c_ie"] ,c_ii=ParamsDict["MODEL_c_ii"],
a_e=numpy.array([1.0]),a_i=numpy.array([1.0]),b_e=numpy.array([1.5]),b_i=numpy.array([2.8]),tau_e=numpy.array([10.0]),
Expand All @@ -155,12 +158,18 @@
if Score > Best_Score:
Best_Score = Score
Best_G = ParamsDict["G"]
Best_Sigma = ParamsDict["Sigma"]
Best_Sigma_e = ParamsDict["Sigma_e"]
Best_Sigma_i = ParamsDict["Sigma_i"]
print(Best_Score)
print(Best_G)
print(Best_Sigma)
print(Best_Sigma_e)
print(Best_Sigma_i)

date = time.strftime("%Y_%m_%d/")
# Create new directory which is the date.
os.makedirs("do-not-track/" + date,exist_ok=True)

# Now export the information:
time_now = time.strftime("%Y%m%d-%H%M%S")
np.savetxt("do-not-track/LCHetVal_Better/" + str(i) + "_" + ParamsDict["name"] + "_Best_" + time_now + "_.csv", [Best_Score,Best_G,Best_Sigma], delimiter="\t")
np.savetxt("do-not-track/LCHetVal_Better/" + str(i) + "_" + ParamsDict["name"] + "_EIHet_" + time_now + "_.csv", [E_normalised,I_normalised], delimiter="\t")
np.savetxt("do-not-track/" + date + str(i) + "_" + ParamsDict["name"] + "_Best_" + time_now + "_.csv", [Best_Score,Best_G,Best_Sigma_e,Best_Sigma_i], delimiter="\t")
np.savetxt("do-not-track/" + date + str(i) + "_" + ParamsDict["name"] + "_EIHet_" + time_now + "_.csv", [E_normalised,I_normalised], delimiter="\t")

0 comments on commit cf79ae4

Please sign in to comment.