Commit afcae45d by Michal Kravcenko

### MOD: modified differential equation examples

parent 312a43ca
 ... @@ -453,15 +453,15 @@ void test_analytical_gradient_y(std::vector &guess, double accuracy, siz ... @@ -453,15 +453,15 @@ void test_analytical_gradient_y(std::vector &guess, double accuracy, siz } } printf("\n--------------------------------------------------\ntest output for gnuplot\n--------------------------------------------------\n"); printf("\n--------------------------------------------------\ntest output for gnuplot\n--------------------------------------------------\n"); if(total_error < 1e-3 || true){ // if(total_error < 1e-3 || true){ /* ISOTROPIC TEST SET */ // /* ISOTROPIC TEST SET */ frac = (te - ts) / (test_size - 1); // frac = (te - ts) / (test_size - 1); for(j = 0; j < test_size; ++j){ // for(j = 0; j < test_size; ++j){ xj = frac * j + ts; // xj = frac * j + ts; // std::cout << j + 1 << " " << xj << " " << eval_f(xj) << " " << eval_approx_f(xj, n_inner_neurons, *params_current) << " " << eval_df(xj) << " " << eval_approx_df(xj, n_inner_neurons, *params_current) << " " << eval_ddf(xj) << " " << eval_approx_ddf(xj, n_inner_neurons, *params_current) << std::endl; // std::cout << j + 1 << " " << xj << " " << eval_f(xj) << " " << eval_approx_f(xj, n_inner_neurons, *params_current) << " " << eval_df(xj) << " " << eval_approx_df(xj, n_inner_neurons, *params_current) << " " << eval_ddf(xj) << " " << eval_approx_ddf(xj, n_inner_neurons, *params_current) << std::endl; } // } } // } /* error analysis */ /* error analysis */ double referential_error = 0.0; double referential_error = 0.0; ... @@ -662,7 +662,7 @@ int main() { ... @@ -662,7 +662,7 @@ int main() { unsigned int n_inner_neurons = 2; unsigned int n_inner_neurons = 2; unsigned int train_size = 10; unsigned int train_size = 10; double accuracy = 1e-4; double accuracy = 1e-3; double ds = 0.0; double ds = 0.0; double de = 4.0; double de = 4.0; ... @@ -674,9 +674,6 @@ int main() { ... @@ -674,9 +674,6 @@ int main() { // size_t n_particles = 100; // size_t n_particles = 100; // test_ode(accuracy, n_inner_neurons, train_size, ds, de, test_size, ts, te, particle_swarm_max_iters, n_particles); // test_ode(accuracy, n_inner_neurons, train_size, ds, de, test_size, ts, te, particle_swarm_max_iters, n_particles); bool optimize_weights = true; bool optimize_biases = true; // std::vector init_guess = {0.35088209, -0.23738505, 0.14160885, 3.72785473, -6.45758308, 1.73769138}; // std::vector init_guess = {0.35088209, -0.23738505, 0.14160885, 3.72785473, -6.45758308, 1.73769138}; std::vector init_guess(3 * n_inner_neurons); std::vector init_guess(3 * n_inner_neurons); ... ...
 ... @@ -795,9 +795,9 @@ void solve_example_particle_swarm(double accuracy, size_t n_inner_neurons, size_ ... @@ -795,9 +795,9 @@ void solve_example_particle_swarm(double accuracy, size_t n_inner_neurons, size_ int main() { int main() { unsigned int n_inner_neurons = 3; unsigned int n_inner_neurons = 4; unsigned int train_size = 10; unsigned int train_size = 10; double accuracy = 1e-5; double accuracy = 1e-3; double ds = 0.0; double ds = 0.0; double de = 1.0; double de = 1.0; ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!