GET_INPUT_NEURONS returns array of input neuron indices Description: This function returns an array of input neuron indices to CurrentNeuron. If there is only one input argument, it gets the input neurons for the network instead. Syntax: InputNeurons=GET_INPUT_NEURONS(ThNN); InputNeurons=GET_INPUT_NEURONS(ThNN, CurrentNeuron); Input Parameters: o ThNN: An object of the theta neuron network class o CurrentNeuron: Optional index to the current neuron. Output Parameters: o InputNeurons: An array of indices of the input neurons to either CurrentNeuron or to the entire network if there is only one input argument. Examples: >> %An extra input reference neuron is added in this example >> ThNN=theta_neuron_network('StructureFormat',{'LayerArray', [3 4 5]}); >> InputNeurons = get_input_neurons(ThNN) >> CurrentInputNeurons = get_input_neurons(ThNN,9) >> %The input reference neuron is removed >> ThNN=theta_neuron_network('ReferenceTime',-1,'StructureFormat',... {'LayerArray', [3 4 5]}); >> InputNeurons = get_input_neurons(ThNN) >> CurrentInputNeurons = get_input_neurons(ThNN,9) >> %Due to recurrency, there are no strictly defined input neurons >> ThNN=theta_neuron_network('ReferenceTime', -1, 'StructureFormat', ... {'ConnectionMatrix', [0 1;1 0]}, 'Io', [0.05 -0.0005]); >> InputNeurons = get_input_neurons(ThNN) See also theta_neuron_network, verbose
0001 function InputNeurons=get_input_neurons(ThNN,CurrentNeuron) 0002 %GET_INPUT_NEURONS returns array of input neuron indices 0003 % 0004 %Description: 0005 %This function returns an array of input neuron indices to CurrentNeuron. 0006 %If there is only one input argument, it gets the input neurons for the 0007 %network instead. 0008 % 0009 %Syntax: 0010 %InputNeurons=GET_INPUT_NEURONS(ThNN); 0011 %InputNeurons=GET_INPUT_NEURONS(ThNN, CurrentNeuron); 0012 % 0013 %Input Parameters: 0014 %o ThNN: An object of the theta neuron network class 0015 %o CurrentNeuron: Optional index to the current neuron. 0016 % 0017 %Output Parameters: 0018 %o InputNeurons: An array of indices of the input neurons to either 0019 % CurrentNeuron or to the entire network if there is only one input 0020 % argument. 0021 % 0022 %Examples: 0023 %>> %An extra input reference neuron is added in this example 0024 %>> ThNN=theta_neuron_network('StructureFormat',{'LayerArray', [3 4 5]}); 0025 %>> InputNeurons = get_input_neurons(ThNN) 0026 %>> CurrentInputNeurons = get_input_neurons(ThNN,9) 0027 % 0028 %>> %The input reference neuron is removed 0029 %>> ThNN=theta_neuron_network('ReferenceTime',-1,'StructureFormat',... 0030 % {'LayerArray', [3 4 5]}); 0031 %>> InputNeurons = get_input_neurons(ThNN) 0032 %>> CurrentInputNeurons = get_input_neurons(ThNN,9) 0033 % 0034 %>> %Due to recurrency, there are no strictly defined input neurons 0035 %>> ThNN=theta_neuron_network('ReferenceTime', -1, 'StructureFormat', ... 0036 % {'ConnectionMatrix', [0 1;1 0]}, 'Io', [0.05 -0.0005]); 0037 %>> InputNeurons = get_input_neurons(ThNN) 0038 % 0039 %See also theta_neuron_network, verbose 0040 0041 %Copyright (C) 2008 Sam McKennoch <Samuel.McKennoch@loria.fr> 0042 0043 0044 if nargin == 1 0045 InputNeurons=ThNN.InputNeurons; 0046 else 0047 InputNeurons=find(ThNN.Weights(:,CurrentNeuron)~=0); 0048 end 0049 return;