Skip to content

Commit

Permalink
clean version for tag
Browse files Browse the repository at this point in the history
  • Loading branch information
elenaquei committed Apr 28, 2022
1 parent 9bd0df9 commit 551e300
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 580 deletions.
Binary file removed bad_parameters.pdf
Binary file not shown.
93 changes: 0 additions & 93 deletions check_bootstrap.py

This file was deleted.

Binary file removed dsgrn_contour_plot.pdf
Binary file not shown.
Binary file removed dsgrn_heat_plot.pdf
Binary file not shown.
Binary file removed dsgrn_plot.pdf
Binary file not shown.
111 changes: 0 additions & 111 deletions level_sets.py

This file was deleted.

56 changes: 1 addition & 55 deletions main_heat_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# use dataset creation
# size of the sample
n_sample = 10 ** 4 # testing on 3, final run on 4
n_sample = 10 ** 3 # testing on 3, final run on 4
file_name = 'TS_data_100000.npz'
try:
np.load(file_name)
Expand All @@ -44,11 +44,6 @@
ninety_percentile = int(np.ceil(len(alpha1)*0.9))
alphaMax = np.array([alpha1[ninety_percentile], alpha2[ninety_percentile]])

plt.figure()
dsgrn_plot(a, alphaMax)
plt.title('all parameters')
plt.savefig('all_parameters.pdf')

parameter_full = np.empty(shape=[0, 5])
lowest_hill = np.empty(0)
bad_parameters = np.empty(shape=[0, 5])
Expand Down Expand Up @@ -99,61 +94,12 @@
print('Number of saddles', len(parameter_full), 'out of ', n_sample)
print('Number of parameters with multiple saddles', len(multiple_saddles), 'out of ', n_sample)

"""if bad_candidates is not None:
fig1 = plt.figure()
dsgrn_plot(bad_candidates, 10)
plt.title('bad candidates')
if boring_parameters is not None:
fig1 = plt.figure()
dsgrn_plot(boring_parameters, 10)
plt.title('No saddle detected')
"""
"""
parameter_DSGRN = parameter_to_DSGRN_coord(parameter_full)
parameter_DSGRN = np.array([parameter_DSGRN[0], parameter_DSGRN[1]])
unique_DSGRN = np.unique(parameter_DSGRN.round(decimals=5), axis=1)
average_sol = np.empty(0)
average_sol_long = 0 * solutions
for j in unique_DSGRN.T:
# work in progress
index_solution_j = np.where(abs(parameter_DSGRN[0, :] - j[0]) < 5 * 10 ** -5)
index_solution_loc = np.where(abs(parameter_DSGRN[1, :] - j[1]) < 5 * 10 ** -5)
index_solution_j = np.intersect1d(index_solution_j, index_solution_loc)
if len(index_solution_j) > 0:
average_sol = np.append(average_sol, np.mean(solutions[index_solution_j]))
average_sol_long[index_solution_j] = np.mean(solutions[index_solution_j])
else:
print('wrong')
"""

plt.figure()
dsgrn_heat_plot(parameter_full, np.minimum(lowest_hill, 100), alphaMax=alphaMax)
plt.title('dsgrn_heat_plot')
plt.savefig('dsgrn_heat_plot.pdf')

plt.figure()
dsgrn_contour_plot(parameter_full, lowest_hill, alphaMax=alphaMax)
plt.title('dsgrn_contour_plot')
plt.savefig('dsgrn_contour_plot.pdf')

plt.figure()
dsgrn_plot(parameter_full, alphaMax=alphaMax)
plt.title('dsgrn_plot')
plt.savefig('dsgrn_plot.pdf')

if len(multiple_saddles) > 0:
plt.figure()
dsgrn_plot(multiple_saddles, alphaMax=alphaMax)
plt.title('multiple_saddles')
plt.savefig('multiple_saddles.pdf')

if len(bad_parameters) > 0:
plt.figure()
dsgrn_plot(bad_parameters, alphaMax=alphaMax)
plt.title('bad_parameters')
plt.savefig('bad_parameters.pdf')

plt.figure()
dsgrn_plot(a, color='tab:blue', alphaMax=alphaMax, alpha=1)
dsgrn_plot(parameter_full, color='tab:green', alphaMax=alphaMax)
Expand Down
Loading

0 comments on commit 551e300

Please sign in to comment.