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

📄 feedforwardlayer.cpp

📁 amygdata的神经网络算法源代码
💻 CPP
字号:
/***************************************************************************                          feedforwardlayer.cpp  -  description                             -------------------    copyright            : (C) 2005 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.                                   * *                                                                         * ***************************************************************************/#include <stdexcept>#include <string> #include "feedforwardlayer.h"#include "synapseproperties.h"#include "synapse.h"#include "nconnector.h"#include "utilities.h"#include "spikingneuron.h"using namespace Amygdala;using namespace std;void FeedForwardLayer::InitNewNeuron(Neuron* nrn){}void FeedForwardLayer::ConnectUniform(Topology * outLayer,                    NConnector & nc,                    SynapseProperties & sProps,                    const float percentConnect){    for(const_iterator itPre = begin(); itPre != end(); itPre++){        for(const_iterator itPost = outLayer->begin(); itPost != outLayer->end(); itPost++){            if(1+(int) (10.0*rand()/(RAND_MAX+1.0)) <= percentConnect){                SpikingNeuron * sn = dynamic_cast <SpikingNeuron *> (*itPost);                if(sn == NULL) throw runtime_error("Neuron id = " +                                                   Utilities::itostr((*itPost)->GetId()) +                                                   " is not a SpikingNeuron");                nc.Connect(*itPre, sn, sProps);            }        }            }}

⌨️ 快捷键说明

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