template<typename type>
class ANN{
private:
struct NEURON;
struct LAYER;
struct ResidualWeight;
void initializeshit(const std::vector<unsigned int>& layern, const std::vector<std::pair<NeuronID, NeuronID>>& ResWeights);
std::vector<type> costvec(const std::vector<type>& target, unsigned int l);
inline static std::vector<LAYER> layers;
static NEURON& IDtoN(NeuronID nID);
inline static type (*actfuncHID)(type in);
inline static type (*actfuncOUT)(type in);
public:
ANN(const std::vector<unsigned int>& layern, const std::vector<std::pair<NeuronID, NeuronID>>& ResWeights, type (*actfuncHIDp)(type), type (*actfuncOUTp)(type));
ANN(std::string filename, bool isBIN, type (*actfuncHIDp)(type), type (*actfuncOUTp)(type));
ANN() = default;
~ANN();
type costavg(const std::vector<type>& target);
std::vector<type> forwardpropagate(const std::vector<type>& input);
void deserializecsv(std::string filename);
void serializecsv(std::string filename);
void deserializebin(std::string filename);
void serializebin(std::string filename);
void resetStructure(const std::vector<int>& layern, const std::vector<std::pair<NeuronID, NeuronID>>& ResWeights);
void backpropagate(const std::vector<type>& input, const std::vector<type>& target, type learn_rate, bool learn_rate_safety);
void deleteNeuron(unsigned int lID);
void addNeuron(unsigned int lID);
void deleteLayer(unsigned int lID);
void addLayer(unsigned int lID, unsigned int s);
void DeleteResidualWeight(NeuronID from, NeuronID to);
void AddResidualWeight(NeuronID from, NeuronID to, type weight);
template<typename TYPE_EVO_TRAINER> friend class EVO_TRAINER;
};```
#sub-class need to use member of super class without member being static
12 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
here layers is required to be used by LAYER and NEURON. but for purposes unknown to me I have create an array of different ANN but becuase layers is static, all ANN objects will be equal.
LAYER and NEURON
Why is layers static?
This sentence doesn’t make any sense to me. Could you rephrase it?
layers is static becuase LAYER has to access it
otherwise it wouldn't be able to
actually I solved the problem by friending LAYER and NEURON to ANN
!solved
Thank you and let us know if you have any more questions!
This thread is now set to auto-hide after an hour of inactivity
sorry for the inconvenience