28 lines
552 B
C++
28 lines
552 B
C++
#pragma once
|
|
|
|
#include "./BackPropagation.h"
|
|
|
|
namespace NeuralNetwork {
|
|
namespace Learning {
|
|
|
|
/** @class OpticalBackPropagation
|
|
* @brief
|
|
*/
|
|
class OpticalBackPropagation : public BackPropagation {
|
|
|
|
public:
|
|
OpticalBackPropagation(): BackPropagation() {
|
|
|
|
}
|
|
virtual ~OpticalBackPropagation() {
|
|
}
|
|
|
|
protected:
|
|
inline virtual float correction(const float & expected, const float &computed) const override {
|
|
register float tmp=(expected-computed);
|
|
register float ret=1+exp(tmp*tmp);
|
|
return tmp < 0? -ret:ret;
|
|
};
|
|
};
|
|
}
|
|
} |