Something went wrong on our end
-
Martin Beseda authored
MERGE: New version of GD algorithm and using Mock objects for unit-testing - not working completely!
Martin Beseda authoredMERGE: New version of GD algorithm and using Mock objects for unit-testing - not working completely!
NormalizationStrategy.h 1.51 KiB
//
// Created by martin on 21.11.18.
//
#ifndef LIB4NEURO_NORMALIZATIONSTRATEGY_H
#define LIB4NEURO_NORMALIZATIONSTRATEGY_H
#include <limits>
#include <vector>
/**
*
*/
class NormalizationStrategy {
protected:
// /**
// *
// */
// double max_value = std::numeric_limits<double>::quiet_NaN();
//
// /**
// *
// */
// double min_value = std::numeric_limits<double>::quiet_NaN();
//
/**
* Maximum (index 0) and minimum (index 1) input value
*/
std::vector<double> max_min_inp_val;
public:
/**
*
*/
struct access;
/**
*
* @param n
* @param max
* @param min
* @return
*/
virtual double normalize(double n, double max, double min) = 0;
/**
*
* @param n
* @param max
* @param min
* @return
*/
virtual double de_normalize(double n) = 0;
/**
*
* @return
*/
double get_max_value();
/**
*
* @return
*/
double get_min_value();
};
/**
*
*/
class DoubleUnitStrategy : public NormalizationStrategy {
public:
/**
*
*/
struct access;
/**
*
*/
DoubleUnitStrategy();
/**
* Normalizes the input value to the interval [-1,1]
*
* @param n
* @param max
* @param min
* @return
*/
double normalize(double n, double max, double min) override;
/**
*
* @param n
* @return
*/
double de_normalize(double n) override;
};
#endif //LIB4NEURO_NORMALIZATIONSTRATEGY_H