#ifndef BLOCK_HPP #define BLOCK_HPP 1 #include #include #include "cell.hpp" using namespace std; class Block { private: // Number of cells, size of input int size, inputVectorSize; // Cells and weights connecting to gates vector cells; vector inGateWeightArray; vector forgetGateWeightArray; vector outGateWeightArray; // Gate values, signals for training double inputGateValue; double forgetGateValue; double outputGateValue; double outputGateSignal; vector cellSignals; // Too lazy to write copy constructor/assignment operator Block& operator=(const Block rhs); Block(Block& l); // calculates a sum of signals based on weights double calcWeightedSignalSum(vector signals, vector weights); public: // Constructor/Desctructor Block(int s, int input_vector_size); ~Block(); // Forward Pass void calcGates(vector inputs); vector calcOutput(vector inputs); // Backward Pass vector calcSignals(vector outputSignals, vector< vector > outputWeights, int blockNum); void updateWeights(double eta, vector layerInput); void clear(); // Access to internal values double getInternalState(int i); double getInputGateValue(); double getForgetGateValue(); double getOutputGateValue(); double getWeight(unsigned int cellNum, unsigned int weightNum); ostream& print(ostream& out); }; ostream& operator<<(ostream& out, Block& b); #endif // BLOCK_HPP