from ModelMain import s_squared, improved_gradient_descent_step
from QuickDataVisualizer import write_comparison_csv
from Utils import get_data_from_csv, find_t0_data_point
from DifferentialModels import Harissons
from AnalyisisMain import fetch_parameters

# create an instance of the EP model
dt = 0.005  # parameters for the Euler's method algorithm
max_t = 6.6
model = Harissons(dt, max_t)


parameters = [fetch_parameters("../HarissonsAnalysisResults", False, data_set_num=2, step_num=1853, method="AGD")]
# some parameters
e1 = 0.01  # value of e1 used in the calculating S^2
e2 = 0.025  # value of e2 used in the calculating S^2

datas = [get_data_from_csv("../Data/exp4_beker{}_data.csv".format(i), t_scale=1) for i in range(1, 5)]
step = improved_gradient_descent_step([datas[1]], model, parameters[0], 1e-5, 1e-1, minimal_second_gradient=1e-7, e1=0.01, e2=0.025)

parameters.append(parameters[0].copy())
for key in parameters[0].keys():
    parameters[-1][key] = parameters[0][key] + step[key]
for p in parameters:
    print(p)


write_comparison_csv("test_result7.csv", datas[1], model, parameters, 0.01)
from ModelMain import s_squared, improved_gradient_descent_step
from QuickDataVisualizer import write_comparison_csv
from Utils import get_data_from_csv
from DifferentialModels import CLV
from AnalyisisMain import fetch_parameters

# create an instance of the EP model
dt = 0.005  # parameters for the Euler's method algorithm
max_t = 6.6
model = CLV(dt, max_t)


parameters = [fetch_parameters("CLVAnalysisResults", False, data_set_num=3, step_num=10874+i, method="AGD")
              for i in range(-4, 3)]

# some parameters
e1 = 0.01  # value of e1 used in the calculating S^2
e2 = 0.025  # value of e2 used in the calculating S^2

datas = [get_data_from_csv("Data/exp4_beker{}_data.csv".format(i), t_scale=1) for i in range(1, 5)]
for p in parameters:
    print(s_squared(datas[2], model, p, e1, e2))
for p in parameters:
    print(improved_gradient_descent_step([datas[2]], model, p, 1e-5, 2e-1, minimal_second_gradient=1e-7, e1=0.01, e2=0.025))

write_comparison_csv("../test_result.csv", datas[2], model, parameters, 0.01)
Example #3
0
from ModelMain import s_squared, improved_gradient_descent_step
from QuickDataVisualizer import write_comparison_csv
from Utils import get_data_from_csv, find_t0_data_point
from DifferentialModels import Harissons
from AnalyisisMain import fetch_parameters

# create an instance of the EP model
dt = 0.005  # parameters for the Euler's method algorithm
max_t = 6.6
model = Harissons(dt, max_t)


parameters = [fetch_parameters("../HarissonsAnalysisResults", True, step_num=192, method="AGD")]
# some parameters
e1 = 0.01  # value of e1 used in the calculating S^2
e2 = 0.025  # value of e2 used in the calculating S^2

datas = [get_data_from_csv("../Data/exp4_beker{}_data.csv".format(i), t_scale=1) for i in range(1, 5)]
step = improved_gradient_descent_step(datas, model, parameters[0], 1e-5, 1e-1, minimal_second_gradient=1e-7, e1=0.01, e2=0.025)

parameters.append(parameters[0].copy())
for key in parameters[0].keys():
    parameters[-1][key] = parameters[0][key] + step[key]
for p in parameters:
    print(p)


write_comparison_csv("test_result8.csv", datas[2], model, parameters, 0.01)
Example #4
0
]

# create an instance of the CLV model
dt = 0.005  # parameters for the Euler's method algorithm
max_t = 6.6
model = CLV(dt, max_t)

# stuff
min_step = 10874
m0 = 1e-7
m_factor = 10**(1 / 10)
f_min = -30
f_max = 50
data_set_num = 3

parameters = fetch_parameters("../CLVAnalysisResults", False, min_step, "AGD",
                              data_set_num)

errors = []

for f in range(f_min, f_max + 1):
    m = m0 * (m_factor**f)
    step = improved_gradient_descent_step([datas[data_set_num - 1]],
                                          model,
                                          parameters,
                                          epsilon,
                                          step_size,
                                          minimal_second_gradient=m,
                                          e1=e1,
                                          e2=e2)
    p = parameters.copy()
    for key in p.keys():