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

📄 topology.h

📁 amygdata的神经网络算法源代码
💻 H
字号:
/***************************************************************************                          topology.h  -  description                             -------------------    copyright            : (C) 2003 by Matt Grover    email                : mgrover@amygdala.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 TOPOLOGY_H#define TOPOLOGY_H#include <amygdala/neurongroup.h>//#include <amygdala/factory.h>namespace Amygdala {class NeuronProperties;class Neuron;/** @class Topology topology.h amygdala/topology.h * @brief The base class for all Neuron containers. * * Topology classes act both as containers for Neurons and as network organizational * units (modules).  A Topology class will typically contain methods for connecting neurons to * other neurons within the same topology object or to neurons in another topology object. * Topology is an abstract base class that descends from NeuronGroup.  Examples of concrete  * Topology classes are FlatLayer and LsmTopology (Liquid state machine).  Topology also * contains the GetFactory() template function which will build a NeuronFactory that * can be used to add Neurons to a particular Topology object (each instantiated Topology * needs at least one NeuronFactory).  Topology objects must be instantiated with the * Network::MakeTopology() factory function. * @see NeuronFactory * @see FlatLayer * @see LsmTopology * @author Matt Grover <mgrover@amygdala.org> */class Topology: public NeuronGroup{public:    virtual ~Topology() = 0;    /** Get a NeuronFactory that can be used to add neurons to the Topology *///    template<class factory>//    factory GetFactory();    void SetDefaultNrnProps(const NeuronProperties& neuronProps);    NeuronProperties * GetDefaultNeuronProperties() const { return defaultNrnProps; }    /** Set the training mode for all neurons belonging to a topology object */    bool TrainingOn(bool on);    /** @return True if training is turned on, false otherwise */    bool TrainingOn();protected:    Topology(std::string& name);    /** Do any class-specific initialization after one of the MakeNeuron() functions has been called. */    virtual void InitNewNeuron(Neuron* nrn);    /** Add a Neuron to the Topology */    virtual void AddNeuron(Neuron* nrn);        /** Do any initialization required before running the sim. This should only     * be called from Network::InitRun() */    void InitRun();        NeuronProperties* defaultNrnProps;    bool trainingOn;private:    friend class Network;    template<class neuron, class neuronProperties>    friend class NeuronFactory;};/*template<class factory>factory Topology::GetFactory(){    return factory(this);}*/}   // namespace Amygdala#endif // TOPOLOGY_H

⌨️ 快捷键说明

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