Commit 93281e20 authored by Michal Kravcenko's avatar Michal Kravcenko

Commit before merge

parent 726018d0
......@@ -51,13 +51,13 @@ double MSE::eval(double *weights) {
return error/n_elements;
}
ERROR_SUM::ERROR_SUM() {
ErrorSum::ErrorSum() {
this->summand = nullptr;
this->summand_coefficient = nullptr;
this->dimension = 0;
}
ERROR_SUM::~ERROR_SUM(){
ErrorSum::~ErrorSum(){
if( this->summand ){
delete this->summand;
}
......@@ -66,7 +66,7 @@ ERROR_SUM::~ERROR_SUM(){
}
}
double ERROR_SUM::eval(double *weights) {
double ErrorSum::eval(double *weights) {
double output = 0.0;
for( unsigned int i = 0; i < this->summand->size(); ++i ){
......@@ -76,7 +76,7 @@ double ERROR_SUM::eval(double *weights) {
return output;
}
void ERROR_SUM::add_error_function(ErrorFunction *F, double alpha) {
void ErrorSum::add_error_function(ErrorFunction *F, double alpha) {
if(!this->summand){
this->summand = new std::vector<ErrorFunction*>(0);
}
......@@ -92,7 +92,7 @@ void ERROR_SUM::add_error_function(ErrorFunction *F, double alpha) {
}
}
size_t ERROR_SUM::get_dimension() {
size_t ErrorSum::get_dimension() {
// if(!this->dimension) {
// size_t max = 0;
// for(auto e : *this->summand) {
......
......@@ -59,17 +59,17 @@ private:
DataSet* ds;
};
class ERROR_SUM : public ErrorFunction{
class ErrorSum : public ErrorFunction{
public:
/**
*
*/
ERROR_SUM();
ErrorSum();
/**
*
*/
~ERROR_SUM();
~ErrorSum();
/**
*
......
......@@ -345,7 +345,7 @@ void DESolver::solve_via_particle_swarm(double *domain_bounds, double c1, double
}
/* DEFINITION OF THE GLOBAL ERROR FUNCTION */
ERROR_SUM total_error;
ErrorSum total_error;
for(unsigned int i = 0; i < this->n_equations; ++i ) {
total_error.add_error_function( error_functions[i], 1.0 );
}
......
......@@ -99,7 +99,7 @@ int main() {
MSE mse_01(subnet_01, &ds_01);
MSE mse_02(subnet_02, &ds_02);
ERROR_SUM mse_sum;
ErrorSum mse_sum;
mse_sum.add_error_function( &mse_01 );
mse_sum.add_error_function( &mse_02 );
......
......@@ -18,7 +18,7 @@
int main() {
unsigned int n_inputs = 1;
unsigned int n_inner_neurons = 64;
unsigned int n_inner_neurons = 4;
unsigned int n_outputs = 1;
unsigned int n_equations = 3;
......@@ -98,7 +98,7 @@ int main() {
/* PARTICLE SWARM TRAINING METHOD SETUP */
unsigned int max_iters = 1000;
unsigned int max_iters = 100;
//must encapsulate each of the partial error functions
double *domain_bounds = new double[ 2 * n_inner_neurons * (n_inputs + n_outputs) ];
......
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