contourNeuronProp.H

Go to the documentation of this file.
00001 /*!@file CINNIC/contourNeuronProp.H CINNIC classes */
00002 //! Holds the property for each neuron
00003 /*! this class is used to process and hold the membrane potential
00004   of each neuron. It keeps track of total potential as well as
00005   potential that is "up" or "down" that is, to simulate the
00006   effects of tranfering energy from neuron to another neuron it
00007   holds energy in either a positive or negative energy bank.
00008 */
00009 //#include "cascadeHold.H"
00010 #include "CINNIC/contourNeuron.H"
00011 //#include "ImageMap.H"
00012 #include "CINNIC/contourDefine.H"
00013 
00014 // //////////////////////////////////////////////////////////////////// //
00015 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2001 by the //
00016 // University of Southern California (USC) and the iLab at USC.         //
00017 // See http://iLab.usc.edu for information about this project.          //
00018 // //////////////////////////////////////////////////////////////////// //
00019 // Major portions of the iLab Neuromorphic Vision Toolkit are protected //
00020 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency //
00021 // in Visual Environments, and Applications'' by Christof Koch and      //
00022 // Laurent Itti, California Institute of Technology, 2001 (patent       //
00023 // pending; application number 09/912,225 filed July 23, 2001; see      //
00024 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status).     //
00025 // //////////////////////////////////////////////////////////////////// //
00026 // This file is part of the iLab Neuromorphic Vision C++ Toolkit.       //
00027 //                                                                      //
00028 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can   //
00029 // redistribute it and/or modify it under the terms of the GNU General  //
00030 // Public License as published by the Free Software Foundation; either  //
00031 // version 2 of the License, or (at your option) any later version.     //
00032 //                                                                      //
00033 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope  //
00034 // that it will be useful, but WITHOUT ANY WARRANTY; without even the   //
00035 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
00036 // PURPOSE.  See the GNU General Public License for more details.       //
00037 //                                                                      //
00038 // You should have received a copy of the GNU General Public License    //
00039 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write   //
00040 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,   //
00041 // Boston, MA 02111-1307 USA.                                           //
00042 // //////////////////////////////////////////////////////////////////// //
00043 //
00044 // Primary maintainer for this file: T. Nathan Mundhenk <mundhenk@usc.edu>
00045 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/CINNIC/contourNeuronProp.H $
00046 // $Id: contourNeuronProp.H 4663 2005-06-23 17:47:28Z rjpeters $
00047 //
00048 
00049 // ############################################################
00050 // ############################################################
00051 // ##### ---CINNIC---
00052 // ##### Contour Integration:
00053 // ##### T. Nathan Mundhenk nathan@mundhenk.com
00054 // ############################################################
00055 // ############################################################
00056 
00057 template <class CH, class X, class Y> class ContourNeuronProp
00058 {
00059 private:
00060   int Count;
00061   bool supress;
00062   CH charge; //charge
00063   CH discharge;
00064   CH chargePos;
00065   CH chargeNeg;
00066   CH totCount;
00067   CH resistance; // Viva La Resistance - Restance divided from energy transplorted
00068   CH supressionMod; //Modifier for adaptive supression
00069   CH supressionModThresh; //Threshold for adaptive supression
00070   CH supressionModChange; //The amount to increment supression
00071   CH supressionCeiling;
00072 protected:
00073   //! Current threshold for this neuron
00074   float threshold; //current_threshold
00075   //float resistance; // Viva La Resistance - Restance divided from energy transplorted
00076 public:
00077 
00078   ContourNeuronProp();
00079   ~ContourNeuronProp();
00080   //! return this neurons charge
00081   CH& getCharge();
00082   //! return this neurons threshold
00083   CH& getThreshold();
00084   //! return this neurons supression modifier
00085   CH& getSupressionMod();
00086   //! set up supression for this neuron
00087   void setSupressionMod(CH& sup);
00088   //! set holder to know if supression has been incremented
00089   void setSupressionBool();
00090   //! set up supression threshold for this neuron and its weight augementation
00091   /*!This method is used to set up adaptive supression for its threshold and the
00092     amount supression will increase every time threshold is reached
00093     @param thresh This is the threshold number
00094     @param changeVal The amount supression should be increased
00095   */
00096   void setSupressionThresh(CH& thresh, CH& changeVal, CH& max);
00097   //! reset the "temporary" charges of this neuron
00098   void ResetTempCharge();
00099   //! reset base charge
00100   void ResetCharge();
00101   //! reset all charges
00102   void ResetChargeAll();
00103   //! set neuron potential to upper limit
00104   void setUpperLimit();
00105   //! input a charge to this neuron, give your polarity so it can be sent on properly
00106   /*! @param charge The charge to give this neuron
00107     @param _pol the polarity you have
00108     @param _sender Is true if you are a sender of cascade
00109   */
00110   inline void Charge(CH& _charge,bool _pol, bool _sender);
00111   //! input a charge to this neuron (potential) without polarity
00112   /*! @param charge The charge to give this neuron
00113   */
00114   void ChargeSimple(CH& _charge);
00115   //! output a charge, make sure it goes to the correct polarity
00116   /*! @param _pol Your polarity
00117     @param _sender Are you a sender?
00118   */
00119   inline CH& DisCharge(bool _pol, bool _sender, int a, int cascadeType);
00120   //! Tell the neuron its saturation level
00121   void setThreshold(CH& Threshold, CH& Resistance);
00122   //when you are all done set the vector counter to 0 to clear all chrages
00123 };
00124 
00125 #if 0
00126 /* commented this out because the array declaration:
00127 
00128    ContourNeuronProp<float,int,int> NeuronMatrix[][][][]
00129 
00130    fails to compile with gcc 3.4:
00131 
00132    contourNeuronProp.H:134: error: declaration of `NeuronMatrix' as
00133    multidimensional array must have bounds for all dimensions except the
00134    first
00135  */
00136 
00137 //! a resizable vector to contain the neuron properties in ContourNeuronProp
00138 /*! this is a container class used to allow ContourNeuronProp for multiple
00139   iterations.
00140 */
00141 
00142 class ContourNeuronPropVec
00143 {
00144 public:
00145   //! container class for the properties of each neuron at each iteration
00146   /*! The vector class is used for multiple iterations */
00147   ContourNeuronProp<float,int,int> NeuronMatrix[][][][];
00148   void setSize(int  t,int i, int j, int k);
00149   int getSizeT();
00150   int T,I,J,K;
00151 };
00152 
00153 #endif
00154 
00155 // ######################################################################
00156 /* So things look consistent in everyone's emacs... */
00157 /* Local Variables: */
00158 /* indent-tabs-mode: nil */
00159 /* End: */
Generated on Sun May 8 08:40:22 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3