dendrite.cpp
来自「amygdata的神经网络算法源代码」· C++ 代码 · 共 73 行
CPP
73 行
/*************************************************************************** dendrite.cpp - description ------------------- begin : Fri Jun 20 2003 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. * * * ***************************************************************************/#include "dendrite.h"#include "synapse.h"#include "spikingneuron.h"#include "network.h"#include "statictrainer.h"#include "logging.h"using namespace Amygdala;Dendrite::Dendrite(SpikingNeuron* postSynapticNrn): totalWeightPos(0.), totalWeightNeg(0.), postNrn(postSynapticNrn), trainer(0), nrnTriggerSet(false), isTraining(false){ LOGGER(5, "Creating dendrite for neuron " << postNrn->GetId());}Dendrite::~Dendrite(){}void Dendrite::SetNrnTrigger(){ LOGGER(6, "Calling Network::ScheduleNeuronProcess for neuron " << postNrn->GetId()); Network::GetNetworkRef()->ScheduleNeuronProcess(postNrn); // reset the weight totals now totalWeightPos=0.0; totalWeightNeg=0.0; nrnTriggerSet = true;}void Dendrite::GetStimulationLevel(float& posTotal, float& negTotal){ LOGGER(6, "Resetting nrnTrigger"); nrnTriggerSet = false; posTotal=totalWeightPos; negTotal=totalWeightNeg;}// FIXME: Need to do checks here to make sure the trainer type matches the trainable// neuron type.void Dendrite::SetTrainer(Trainer* t){ trainer = t;}void Dendrite::ReportSpike(){ if (trainer) trainer->ReportSpike(postNrn);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?