SET_IO_DATA sets GUI parameters that change with dataset choices Description: Function to set the GUI parameters that change when a new dataset is choosen. For example, the choices of plots in the extra plot must be updated as well the number of neurons in each layer. Syntax: SET_IO_DATA(Handles,ThNN,TrainingParams); Input Parameters: o Handles: A structure containing the handles to all the GUI objects, as generated in ThNN_GUI. o LoadFile: Path and file containing the dataset information. o DataName: String containing the name of the dataset. Output Parameters: o Status: A Boolean flag indicating the success of execution. Example: >> GUIHandle=start_ThNN; >> Temp=get(GUIHandle,'UserData'); >> Handles=Temp{2}; >> TrainingParams=get_training_params(Handles); >> set_io_data(Handles,[pwd, C, 'Datasets', C, 'Regression', C, TrainingParams.DataName],... TrainingParams.DataName); See also theta_neuron_network
0001 function status=set_io_data(Handles,LoadFile,DataName) 0002 %SET_IO_DATA sets GUI parameters that change with dataset choices 0003 % 0004 %Description: 0005 %Function to set the GUI parameters that change when a new dataset is 0006 %choosen. For example, the choices of plots in the extra plot must be 0007 %updated as well the number of neurons in each layer. 0008 % 0009 %Syntax: 0010 %SET_IO_DATA(Handles,ThNN,TrainingParams); 0011 % 0012 %Input Parameters: 0013 %o Handles: A structure containing the handles to all the GUI objects, 0014 % as generated in ThNN_GUI. 0015 %o LoadFile: Path and file containing the dataset information. 0016 %o DataName: String containing the name of the dataset. 0017 % 0018 %Output Parameters: 0019 %o Status: A Boolean flag indicating the success of execution. 0020 % 0021 %Example: 0022 %>> GUIHandle=start_ThNN; 0023 %>> Temp=get(GUIHandle,'UserData'); 0024 %>> Handles=Temp{2}; 0025 %>> TrainingParams=get_training_params(Handles); 0026 %>> set_io_data(Handles,[pwd, C, 'Datasets', C, 'Regression', C, TrainingParams.DataName],... 0027 % TrainingParams.DataName); 0028 % 0029 %See also theta_neuron_network 0030 0031 %Copyright (C) 2008 Sam McKennoch <Samuel.McKennoch@loria.fr> 0032 0033 0034 status=1; 0035 try 0036 load(LoadFile); 0037 NumTests=0; 0038 if strcmp(EncodeMethod,'Spikes') 0039 %Assume each synapse has at least one input spikes. 0040 NumInputs=length(unique(InputSpikeTimes{1}(:,1))); 0041 NumOutputs=length(unique(DesiredSpikeTimes{1}(:,1))); 0042 NumPatterns=length(InputSpikeTimes); 0043 if TestFlag 0044 NumTests=length(TestingInputSpikeTimes); 0045 end 0046 else 0047 NumInputs=size(Inputs,2); 0048 NumOutputs=size(Outputs,2); 0049 NumPatterns=size(Inputs,1); 0050 if TestFlag 0051 NumTests=size(TestingInputs,1); 0052 end 0053 end 0054 0055 TrainingMethods=get(Handles.Training_Method,'String'); 0056 PlotNames={}; 0057 PlotNames{1}='Choose From Below'; 0058 set(Handles.Training_Method,'Enable','on'); 0059 DataType=get(Handles.Training_Data,'UserData'); 0060 if strfind(DataType,'Classification') 0061 PlotNames{2}='Classification Error'; 0062 elseif strfind(DataType,'Regression') 0063 PlotNames{2}='Function Approximation'; 0064 end 0065 set(Handles.AvailablePlots,'String',PlotNames); 0066 if strfind(DataType,'SpikeTimes') 0067 set(Handles.AvailablePlots,'Value',1); 0068 else 0069 set(Handles.AvailablePlots,'Value',2); 0070 end 0071 set(Handles.Input_Data,'String',DataName); 0072 set(Handles.Num_Inputs,'String',NumInputs); 0073 set(Handles.Num_Outputs,'String',NumOutputs); 0074 set(Handles.Num_Patterns,'String',NumPatterns); 0075 set(Handles.Num_Tests,'String',NumTests); 0076 catch 0077 disp('Error in set_io_data!'); 0078 status=-1; 0079 end 0080 0081 return;