Home > TNNT_1_07 > FrontEnd > get_network.m

get_network

PURPOSE ^

GET_NETWORK creates a Theta Neuron Network from GUI parameters

SYNOPSIS ^

function ThNN=get_network(Handles)

DESCRIPTION ^

GET_NETWORK creates a Theta Neuron Network from GUI parameters

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function ThNN=get_network(Handles)
0002 %GET_NETWORK creates a Theta Neuron Network from GUI parameters
0003 
0004 
0005 
0006 
0007 NIPS2007Gradient=get(Handles.NIPS2006_Gradient,'Value');
0008 
0009 ReferenceTime=str2num(get(Handles.Reference_Time,'String'));
0010 
0011 if get(Handles.Initialize_Weight_Type,'Value')
0012     InitialWeightMethod={'RandomNormal', str2num(get(Handles.Initial_Weight,'String')), abs(str2num(get(Handles.Initial_Weight,'String'))/10)};
0013 else
0014     InitialWeightMethod={'Fixed', str2num(get(Handles.Initial_Weight,'String'))};
0015 end
0016 %Later update the signs....
0017 
0018 if get(Handles.Initialize_Tau_Type,'Value')
0019     InitialDelayMethod={'RandomNormal', str2num(get(Handles.Initial_Tau,'String')), abs(str2num(get(Handles.Initial_Tau,'String'))/10)};
0020 else
0021     InitialDelayMethod={'Fixed', str2num(get(Handles.Initial_Tau,'String'))};
0022 end
0023 
0024 Num_Inputs=str2num(get(Handles.Num_Inputs,'String'));
0025 Num_Hidden=str2num(get(Handles.Num_Hidden_Neurons,'String'));
0026 Num_Outputs=str2num(get(Handles.Num_Outputs,'String'));
0027 if Num_Hidden>0
0028     StructureFormat={'LayerArray', [Num_Inputs Num_Hidden Num_Outputs]};
0029 else
0030     StructureFormat={'LayerArray', [Num_Inputs Num_Outputs]};
0031 end
0032 
0033 Alpha=str2num(get(Handles.Alpha,'String'));
0034 
0035 if ReferenceTime>=0
0036     Num_Inputs=Num_Inputs+1;
0037 end
0038 if get(Handles.Randomize_Inot,'Value')
0039     Io=[0*ones(1,Num_Inputs)...
0040         str2num(get(Handles.Hidden_Inot,'String'))+(str2num(get(Handles.Hidden_Inot,'String'))/10)*randn(1,Num_Hidden)...
0041         str2num(get(Handles.Output_Inot,'String'))+(str2num(get(Handles.Output_Inot,'String'))/10)*randn(1,Num_Outputs)];    
0042 else
0043     Io=[0*ones(1,Num_Inputs)...
0044         str2num(get(Handles.Hidden_Inot,'String'))*ones(1,Num_Hidden)...
0045         str2num(get(Handles.Output_Inot,'String'))*ones(1,Num_Outputs)];
0046 end
0047 
0048 ThNN=theta_neuron_network(...
0049     'NIPS2007Gradient',NIPS2007Gradient,...
0050     'ReferenceTime',ReferenceTime,...
0051     'InitialWeightMethod',InitialWeightMethod,...
0052     'InitialDelayMethod',InitialDelayMethod,...
0053     'StructureFormat',StructureFormat,...
0054     'Alpha',Alpha,...
0055     'Io',Io);
0056 
0057 if get(Handles.Initialize_Weight_Sign,'Value')
0058     ThNN.Weights=(2*round(rand(size(ThNN.Weights)))-1).*ThNN.Weights;
0059 end

Generated on Wed 02-Apr-2008 15:16:32 by m2html © 2003