perceptron implementation changed + perceptronLearningAlgorithm and tests
This commit is contained in:
@@ -13,7 +13,15 @@ namespace FeedForward {
|
||||
|
||||
using Network::computeOutput;
|
||||
using Network::randomizeWeights;
|
||||
using Network::operator[];
|
||||
|
||||
inline std::size_t size() const {
|
||||
return layers[1]->size();
|
||||
}
|
||||
|
||||
inline NeuronInterface& operator[](const std::size_t& neuron) {
|
||||
return layers[1]->operator[](neuron);
|
||||
}
|
||||
|
||||
protected:
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,19 +3,18 @@
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
|
||||
#include <NeuralNetwork/FeedForward/Network.h>
|
||||
#include "CorrectionFunction/Linear.h"
|
||||
#include <NeuralNetwork/FeedForward/Perceptron.h>
|
||||
|
||||
namespace NeuralNetwork {
|
||||
namespace Learning {
|
||||
|
||||
/** @class BackPropagation
|
||||
* @brief
|
||||
/** @class PerceptronLearning
|
||||
* @brief Basic algorithm for learning Perceptron
|
||||
*/
|
||||
class PerceptronLearning {
|
||||
|
||||
public:
|
||||
inline PerceptronLearning(FeedForward::Network &feedForwardNetwork): network(feedForwardNetwork), learningCoefficient(0.4) {
|
||||
inline PerceptronLearning(FeedForward::Perceptron &perceptronNetwork): perceptron(perceptronNetwork), learningCoefficient(0.1) {
|
||||
}
|
||||
|
||||
virtual ~PerceptronLearning() {
|
||||
@@ -30,7 +29,7 @@ namespace NeuralNetwork {
|
||||
|
||||
protected:
|
||||
|
||||
FeedForward::Network &network;
|
||||
FeedForward::Perceptron &perceptron;
|
||||
|
||||
float learningCoefficient;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user