⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cherrymoya.h

📁 此代码经过大量使用
💻 H
字号:
/***************************************************************************                          cherrymoya.h  -  description                             -------------------    begin                : Sat Jan 19 2002    copyright            : (C) 2002 by Rudiger Koch    email                : rkoch@rkoch.org ***************************************************************************//*************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/#ifndef CHERRYMOYA_H#define CHERRYMOYA_Husing namespace std;#include <amygdala/genomehandler.h>#include <amygdala/neuron.h>#include <pair.h>/**Implements the Cherrymoya model of genome generated Amygdala neural networks.  *@author Rudiger Koch  */class Cherrymoya : public GenomeHandler  {public:    /**     * @param the radius of the Cherrymoya     */  	Cherrymoya(unsigned int r);  	~Cherrymoya();//  implemented methods from base class    virtual void gene (string gene);    virtual void startChromosome(int geneLength, int genes);    virtual void finish();    /** Read property of unsigned int radius. */    virtual const int& getradius();    /** return the Network generated by this class. This function is only temporary. */    Network* getNetwork();    /** @return a vector of all input neurons in the order of the genes in their chromosome */    vector <AmIdInt> GetInputNeurons();    /** @return a vector of all output neurons in the order the genes appear in their chromosome */    vector <Neuron*> GetOutputNeurons();private: // Private attributes    /** The step size along the axon. Making this too small will result        in longer NN build time. Making it too big might miss neurons */    float stepSize;    /** The currently processed chromosome */    unsigned int N_chromosome;    /** The currently processed gene */    unsigned int N_gene;    /** The radius of the Sphere. This includes the skin layer. */    int radius;    /** The radius of the dendrites */    float dendriteRadius;    float offset;    /** calibrate the axon length */    float axonLengthFactor;    /** the boolean indicates whether the neuron is in the meat or outside     * A NULL value for the neuron indicates that there is no neuron at this     * location */    vector < vector < vector <pair <bool, Neuron *> > > > theCherrymoya;    /*  The pair are < (strength of the singularity) , (reference to an associated skin neuron) >        This reference is needed to get the location */    vector < float* > skinSingularities;    /*  The pair are < (strength of the singularity) , (an reference to an input neuron) >        This reference is needed to get the location */    vector < pair < float, Neuron*> > inputNeurons;    /*  The pair are < (strength of the singularity) , (an reference to an output neuron) >        This reference is needed to get the location */    vector < pair < float, Neuron*> > outputNeurons;    LayerConstants layerConst;    Layer *hiddenLayer;    Layer *inputLayer;    Layer *outputLayer;    unsigned int nId;    enum cherrymoyaPart { SKIN=1, IN, OUT };    Network *net;    /** Only for statistical output - not used for anything important */    unsigned int synapses;protected: // Private methods    void BuildCherrymoya();    /** Connect all input neurons */    void connectInputNeurons();    /** Connect all neurons in the skin */    void connectSkin();    /** Connect all neurons in the meat */    void connectMeat();    /** puts the Strength of the field within the meat at location into E. */    void getFieldStrengthMeat(float *location, float *E);    /** puts the Strength of the field within the skin at location into E. */    void getFieldStrengthSkin(float *location, float *E);    /** Connect a hidden layer meat neuron      * running along an axon. Connect all intersecting dendrites.      * Also connects the output neurons      * @param currentNeuron the presynaptic neuron      */    void AxonConnector3D(Neuron *currentNeuron);    /** Connect a hidden layer skin neuron      * running along an axon. Connect all intersecting dendrites.      * There are 2 physical axons: one running around the skin and one pointing to the center      * of the sphere.      * Also connects the output neurons      * @param currentNeuron the presynaptic neuron      */    void AxonConnectorSkin(Neuron *currentNeuron);};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -