Home > SaliencyToolbox > evolveWTA.m

evolveWTA

PURPOSE ^

evolveWTA - evolves the winner-take-all network by one time step.

SYNOPSIS ^

function [wta,winner] = evolveWTA(wta)

DESCRIPTION ^

 evolveWTA - evolves the winner-take-all network by one time step.

 [wta,winner] = evolveWTA(wta)
    Evolves wta by one time step, returns the resulting wta,
    and returns the winner coordinates if a winner was found.

 See also evolveLeakyIntFire, runSaliency, dataStructures.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % evolveWTA - evolves the winner-take-all network by one time step.
0002 %
0003 % [wta,winner] = evolveWTA(wta)
0004 %    Evolves wta by one time step, returns the resulting wta,
0005 %    and returns the winner coordinates if a winner was found.
0006 %
0007 % See also evolveLeakyIntFire, runSaliency, dataStructures.
0008 
0009 % This file is part of the SaliencyToolbox - Copyright (C) 2006-2013
0010 % by Dirk B. Walther and the California Institute of Technology.
0011 % See the enclosed LICENSE.TXT document for the license agreement.
0012 % More information about this project is available at:
0013 % http://www.saliencytoolbox.net
0014 
0015 function [wta,winner] = evolveWTA(wta)
0016 
0017 time = wta.exc.time + wta.exc.timeStep;
0018 winner = [-1,-1];
0019 
0020 % first evolve the sm
0021 wta.sm = evolveLeakyIntFire(wta.sm,time);
0022 
0023 % set the input into the excitatory WTA neurons to the output of the sm
0024 wta.exc.I = wta.sm.V .* wta.exc.Ginput;
0025 
0026 % evolve the excitatory neurons of the WTA network
0027 [wta.exc,spikes] = evolveLeakyIntFire(wta.exc,time);
0028 
0029 % erase any inhibitions we might have had
0030 wta.exc.Ginh = 0;
0031 
0032 % did anyone fire?
0033 if any(spikes(:))
0034   idx = find(spikes); idx = idx(1);
0035   [winner(1),winner(2)] = ind2sub(size(spikes),idx);
0036     
0037   debugMsg(sprintf('winner: (%d,%d) at %f ms',winner(1),winner(2),time*1000));
0038   debugMsg(sprintf('SM voltage at winner: %g mV above rest',wta.sm.V(idx)*1000));
0039 
0040   % the inihibitory interneuron gets all excited about the winner
0041   wta.inhib.Gexc = wta.inhib.Gleak * 10;
0042 end
0043   
0044 % evolve the inhibitory interneuron
0045 [wta.inhib,spike] = evolveLeakyIntFire(wta.inhib,time);
0046 if (spike)
0047   % trigger global inhibition
0048   wta.exc.Ginh = 1e-2;
0049   
0050   % no need to be excited anymore
0051   wta.inhib.Gexc = 0;
0052 end

Generated on Thu 18-Jul-2013 06:10:46 by m2html © 2005