modified BP interface
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "./BackPropagation.h"
|
||||
#include "./CorrectionFunction/Optical.h"
|
||||
|
||||
namespace NeuralNetwork {
|
||||
namespace Learning {
|
||||
@@ -11,18 +12,12 @@ namespace Learning {
|
||||
class OpticalBackPropagation : public BackPropagation {
|
||||
|
||||
public:
|
||||
OpticalBackPropagation(FeedForward::Network &feedForwardNetwork): BackPropagation(feedForwardNetwork) {
|
||||
OpticalBackPropagation(FeedForward::Network &feedForwardNetwork): BackPropagation(feedForwardNetwork,new CorrectionFunction::Optical()) {
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user