Commit 089d5a60 authored by Michal Kravcenko's avatar Michal Kravcenko

Added an explicit solution of the first PDE example via a gradient

descent method
parent c46dd8d4
......@@ -312,11 +312,11 @@ void ParticleSwarm::optimize( double gamma, double epsilon, double delta) {
// TODO - only in verbose mode
// only for info purposes
euclidean_dist += this->get_euclidean_distance(particle->get_coordinate(), centroid);
if(this->get_euclidean_distance(particle->get_coordinate(), centroid) < epsilon) {
cluster.insert(particle);
}
// euclidean_dist += this->get_euclidean_distance(particle->get_coordinate(), centroid);
//
// if(this->get_euclidean_distance(particle->get_coordinate(), centroid) < epsilon) {
// cluster.insert(particle);
// }
}
//}
......@@ -325,7 +325,7 @@ void ParticleSwarm::optimize( double gamma, double epsilon, double delta) {
//TODO only in verbose mode
euclidean_dist /= this->n_particles;
if(outer_it % 10 == 0){
if(outer_it % 1 == 0){
printf("Iteration %d, avg euclidean distance: %f, cluster percent: %f, f-value: %f\r", (int)outer_it, euclidean_dist,
double(cluster.size())/this->n_particles, optimal_value);
std::cout.flush();
......
......@@ -7,6 +7,8 @@
//TODO incorporate uncertainities as coefficients in NeuralNetworkSum or ErrorSum
//TODO add support for multiple unknown functions to be found
//TODO add export capability?
//TODO restructure of the learning methods to have a common parent to be used as a parameter in the solvers
#ifndef INC_4NEURO_PDESOLVER_H
#define INC_4NEURO_PDESOLVER_H
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment