Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-02 08:48:23

0001 /*
0002  * NeuralNetworkCell.h
0003  *
0004  *  Created on: Apr 24, 2016
0005  *      Author: Pawel Sznajder
0006  */
0007 
0008 #ifndef NEURALNETWORKCELL_H_
0009 #define NEURALNETWORKCELL_H_
0010 
0011 #include <string>
0012 #include <vector>
0013 
0014 #include "../beans/NeuralNetworkCellPropertyType.h"
0015 #include "../beans/NeuralNetworkCellType.h"
0016 #include "../neural_network_neuron/NeuralNetworkNeuron.h"
0017 
0018 namespace NumA {
0019 
0020 class NeuralNetworkCell {
0021 
0022 public:
0023 
0024     NeuralNetworkCell();
0025     NeuralNetworkCell(const std::string& name,
0026             NeuralNetworkCellType::Type type);
0027     virtual ~NeuralNetworkCell();
0028     virtual NeuralNetworkCell* clone() const;
0029     virtual std::string toString() const;
0030 
0031     NeuralNetworkCellType::Type getType() const;
0032 
0033     virtual void evaluate();
0034     virtual double evaluateDerivativeBackward(
0035             NeuralNetworkNeuron* const neuron) const;
0036 
0037     const std::vector<NeuralNetworkNeuron*>& getNeuronsIn() const;
0038     void setNeuronsIn(const std::vector<NeuralNetworkNeuron*>& neurons);
0039     void addNeuronIn(NeuralNetworkNeuron* const neuron);
0040     const std::vector<NeuralNetworkNeuron*>& getNeuronsOut() const;
0041     void setNeuronsOut(const std::vector<NeuralNetworkNeuron*>& neurons);
0042     void addNeuronOut(NeuralNetworkNeuron* const neuron);
0043 
0044     double getOutput() const;
0045     void setOutput(double output);
0046 
0047     virtual void checkConsistency() const;
0048     bool checkProperty(NeuralNetworkCellPropertyType::Type property) const;
0049 
0050 protected:
0051 
0052     NeuralNetworkCell(const NeuralNetworkCell& other);
0053 
0054     double m_output;
0055     std::vector<NeuralNetworkNeuron*> m_neuronsIn;
0056     std::vector<NeuralNetworkNeuron*> m_neuronsOut;
0057     std::vector<NeuralNetworkCellPropertyType::Type> m_properties;
0058 
0059 private:
0060 
0061     NeuralNetworkCellType::Type m_type;
0062 };
0063 
0064 }
0065 
0066 #endif /* NEURALNETWORKCELL_H_ */