diff --git a/include/NeuralNetwork/ConstructiveAlgorithms/CascadeCorrelation.h b/include/NeuralNetwork/ConstructiveAlgorithms/CascadeCorrelation.h index 278ea31..c8bf376 100644 --- a/include/NeuralNetwork/ConstructiveAlgorithms/CascadeCorrelation.h +++ b/include/NeuralNetwork/ConstructiveAlgorithms/CascadeCorrelation.h @@ -54,7 +54,7 @@ namespace NeuralNetwork { std::cout << error << "\n"; - if(_prunningStatus && error*1.01 >= lastError) { // it is not getting bettter + if(_pruningStatus && error*_pruningLimit >= lastError) { // it is not getting bettter network.removeLastHiddenNeuron(); error=lastError; std::cout << "PRUNED\n"; @@ -93,12 +93,13 @@ namespace NeuralNetwork { return _epoch; } - void setPruningStatus(bool status) { - _prunningStatus=status; + void setPruningLimit(float limit) { + _pruningStatus=true; + _pruningLimit=limit; } - bool getPruningStatus() const { - return _prunningStatus; + bool getPruningLimit() const { + return _pruningLimit; } void setErrorThreshold(float err) { @@ -155,7 +156,8 @@ namespace NeuralNetwork { float _errorTreshold; float _weightRange; - bool _prunningStatus = false; + bool _pruningStatus = false; + float _pruningLimit=0.0; std::size_t _epoch = 0; std::size_t _maxHiddenUnits = 20;