cascade
This commit is contained in:
@@ -66,8 +66,6 @@ std::pair<std::shared_ptr<NeuralNetwork::Neuron>, std::vector<float>> Cascade2::
|
||||
float weight = candidateWeights[candidateIndex][output];
|
||||
float diff = activationValue * weight - errors[patternIndex][output];
|
||||
|
||||
float goalDir= pattern.second[output] <0.0? -1.0 :1.0;
|
||||
float diffDir= diff >0.0? -1.0 :1.0;
|
||||
score -= (diff * diff);
|
||||
outSlopes[output] -= 2.0 * diff * activationValue;
|
||||
errSum += diff * weight;
|
||||
|
||||
@@ -190,6 +190,10 @@ std::pair <std::shared_ptr<NeuralNetwork::Neuron>, std::vector<float>> CascadeCo
|
||||
}
|
||||
}
|
||||
|
||||
if(sumSquareError < 0.01) {
|
||||
sumSquareError=0.01;
|
||||
}
|
||||
|
||||
std::for_each(meanErrors.begin(), meanErrors.end(), [&patterns](float &n) { n /= patterns.size(); });
|
||||
|
||||
struct CAND {
|
||||
|
||||
Reference in New Issue
Block a user