2015-03-23 20:58:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Neuron.h"
|
|
|
|
|
|
|
|
class Layer : public std::vector < Neuron >
|
|
|
|
{
|
2015-10-18 19:20:37 +00:00
|
|
|
private:
|
2015-10-25 16:40:22 +00:00
|
|
|
bool m_hasBiasNeuron = false;
|
2015-10-18 19:20:37 +00:00
|
|
|
|
2015-03-23 20:58:30 +00:00
|
|
|
public:
|
2015-10-15 20:37:13 +00:00
|
|
|
Layer(size_t numNeurons);
|
2015-03-23 20:58:30 +00:00
|
|
|
|
|
|
|
void setOutputValues(const std::vector<double> & outputValues);
|
2015-10-27 14:33:10 +00:00
|
|
|
|
2015-03-23 20:58:30 +00:00
|
|
|
void feedForward(const Layer &inputLayer);
|
2015-10-26 06:33:45 +00:00
|
|
|
double getWeightedSum(size_t outputNeuron) const;
|
2015-10-31 13:59:10 +00:00
|
|
|
void connectTo(const Layer &nextLayer);
|
2015-10-16 20:59:04 +00:00
|
|
|
|
2015-10-17 20:05:27 +00:00
|
|
|
void updateInputWeights(Layer &prevLayer);
|
2015-10-18 19:20:37 +00:00
|
|
|
|
|
|
|
void addBiasNeuron();
|
|
|
|
|
2015-10-25 16:40:22 +00:00
|
|
|
bool hasBiasNeuron() const;
|
2015-10-18 19:20:37 +00:00
|
|
|
size_t sizeWithoutBiasNeuron() const;
|
2015-03-23 20:58:30 +00:00
|
|
|
};
|