Circuits.H

Go to the documentation of this file.
00001 /*!@file ModelNeuron/Circuits.H Class for various types of simple
00002    neural circuits */
00003 
00004 // //////////////////////////////////////////////////////////////////// //
00005 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2001 by the //
00006 // University of Southern California (USC) and the iLab at USC.         //
00007 // See http://iLab.usc.edu for information about this project.          //
00008 // //////////////////////////////////////////////////////////////////// //
00009 // Major portions of the iLab Neuromorphic Vision Toolkit are protected //
00010 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency //
00011 // in Visual Environments, and Applications'' by Christof Koch and      //
00012 // Laurent Itti, California Institute of Technology, 2001 (patent       //
00013 // pending; application number 09/912,225 filed July 23, 2001; see      //
00014 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status).     //
00015 // //////////////////////////////////////////////////////////////////// //
00016 // This file is part of the iLab Neuromorphic Vision C++ Toolkit.       //
00017 //                                                                      //
00018 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can   //
00019 // redistribute it and/or modify it under the terms of the GNU General  //
00020 // Public License as published by the Free Software Foundation; either  //
00021 // version 2 of the License, or (at your option) any later version.     //
00022 //                                                                      //
00023 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope  //
00024 // that it will be useful, but WITHOUT ANY WARRANTY; without even the   //
00025 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
00026 // PURPOSE.  See the GNU General Public License for more details.       //
00027 //                                                                      //
00028 // You should have received a copy of the GNU General Public License    //
00029 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write   //
00030 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,   //
00031 // Boston, MA 02111-1307 USA.                                           //
00032 // //////////////////////////////////////////////////////////////////// //
00033 //
00034 // Primary maintainer for this file: David Berg <dberg@usc.edu>
00035 // $HeadURL: svn://ilab.usc.edu:/trunk/saliency/src/ModelNeuron/Circuits.H $
00036 
00037 #ifndef MODELNEURON_CIRCUITS_H_DEFINED
00038 #define MODELNEURON_CIRCUITS_H_DEFINED
00039 
00040 #include "ModelNeuron/NeuralColumn.H"
00041 #include "ModelNeuron/IZNeuron.H"
00042 
00043 // ######################################################################
00044 //! A Threshold circuit that slowly accumulates input and then
00045 //releases a short burst of spikes. The circuit contains a regular
00046 //spiking neuron that will spike tonically when stimulated and
00047 //excite a burst neuron that will integrate its input and produce a
00048 //short burst of spikes when a threshold is reached. The regular
00049 //spiking neuron also feeds to a fast spiking interneuron, which
00050 //inhibits the burst neuron.
00051 //######################################################################
00052 struct ThresholdCircuit : public NeuralColumn<IZNeuron>
00053 {
00054   ThresholdCircuit(const double& thresh = 1, const std::string& name="Threshold", const std::string& units="Spike")
00055     : NeuralColumn<IZNeuron>(SimTime::MSECS(1.0), SimUnit::STRICT, name, units)
00056   {
00057     addSub(RSNeuron());
00058     addSub(EBNeuron());
00059     addSub(FSNeuron());
00060     
00061     addWeight(-1, 0, 1.0F);//input->RS
00062     addWeight(0,  1, thresh * 1.0F);//RS->EB
00063     addWeight(1, -1, 1.0F);//EB->output
00064     addWeight(0,  2,  3.0F);//RS->FS
00065     addWeight(2,  1, -1.0F);//FS->EB
00066   }
00067 };
00068 
00069 // ######################################################################
00070 //! A bandpass filter to demonstrate use of NeuralColumn
00071 //! calculates a bandpass as a lowpass subtract a larger lowpass
00072 //######################################################################
00073 struct BandpassFilter : public NeuralColumn<SimUnit*>
00074 {
00075   BandpassFilter(const double& tau, const double& bandwidth, const SimTime time, 
00076                  const std::string& name="Bandpass", const std::string& units="pA") 
00077     :   NeuralColumn<SimUnit*>(time, SimUnit::NORMAL, name, units)
00078   {
00079     double simtime = 1;
00080     if (tau / 5.0 >= 1.0)
00081       simtime = tau/5;
00082 
00083     addSub( LowPassMaxRect(tau, 0.0, 0.0, 1.0, SimTime::MSECS(simtime)) );
00084     addSub( LowPass(tau + tau*bandwidth, 0.0, SimTime::MSECS(simtime)) );
00085     
00086     addWeight(-1, 0, 1.0F);
00087     addWeight(0, 1, 1.0F);
00088     addWeight(0, -1, 1.0F);
00089     addWeight(1, -1, -1.0F);
00090   }
00091 };
00092 
00093 // ######################################################################
00094 // Register circuits types
00095 // ######################################################################
00096 namespace 
00097 {
00098   typedef SimUnit::Factory CircuitFactory;
00099   typedef SimUnit::Creator CircuitCreator;
00100 
00101   //define creation functions
00102   struct RegisterCircuits
00103   {
00104     RegisterCircuits()
00105     {
00106       CircuitFactory::instance().add("ThresholdCircuit", CircuitCreator::make<ThresholdCircuit>(1.0));
00107       CircuitFactory::instance().add("BandpassFilter", CircuitCreator::make<BandpassFilter>(50.0, 1.0, 
00108                                                                                             SimTime::MSECS(1.0)));
00109     }
00110   };
00111   static RegisterCircuits registercircuits;
00112 }
00113 
00114 #endif
00115 // ######################################################################
00116 /* So things look consistent in everyone's emacs... */
00117 /* Local Variables: */
00118 /* indent-tabs-mode: nil */
00119 /* End: */
Generated on Sun May 8 08:41:01 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3