Cascade2 algo implementation
This commit is contained in:
31
include/NeuralNetwork/ConstructiveAlgorithms/Cascade2.h
Normal file
31
include/NeuralNetwork/ConstructiveAlgorithms/Cascade2.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include "../Cascade/Network.h"
|
||||
#include "../FeedForward/Network.h"
|
||||
#include "../Learning/QuickPropagation.h"
|
||||
|
||||
#include "CascadeCorrelation.h"
|
||||
|
||||
#include <random>
|
||||
#include <algorithm>
|
||||
|
||||
// http://fann.cvs.sourceforge.net/viewvc/fann/fann/src/fann_cascade.c?view=markup
|
||||
// https://github.com/gtomar/cascade
|
||||
|
||||
namespace NeuralNetwork {
|
||||
namespace ConstructiveAlgorihtms {
|
||||
class Cascade2 : public CascadeCorrelation {
|
||||
public:
|
||||
typedef std::pair<std::vector<float>, std::vector<float>> TrainingPattern;
|
||||
|
||||
Cascade2(std::size_t numberOfCandidate = 18, float maxError = 0.7) : CascadeCorrelation(numberOfCandidate, maxError) {
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
virtual std::pair<std::shared_ptr<Neuron>, std::vector<float>> trainCandidates(Cascade::Network &network, std::vector<std::shared_ptr<Neuron>> &candidates,
|
||||
const std::vector<TrainingPattern> &patterns) override;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user