0001 function TrainingParams=get_training_params(varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 if nargin==1 && isstruct(varargin{1})
0035 Temp=struct2cell(varargin{1});
0036 IsHandle=min(ishandle([Temp{:,1}]));
0037 else
0038 IsHandle=0;
0039 end
0040
0041 TrainingParams=[];
0042 if nargin==1 && IsHandle
0043 Handles=varargin{1};
0044 TrainingParams.DataName=get(Handles.Input_Data,'String');
0045 if get(Handles.Spike_Times,'Value')>1
0046 TrainingParams.Type='SpikeTimes';
0047 elseif get(Handles.Regression,'Value')>1
0048 TrainingParams.Type='Regression';
0049 elseif get(Handles.Classification,'Value')>1
0050 TrainingParams.Type='Classification';
0051 else
0052 TrainingParams.Type='None';
0053 end
0054
0055
0056 Training_Method_Strings=(get(Handles.Training_Method,'String'));
0057 TrainingParams.LearningMethod=Training_Method_Strings{(get(Handles.Training_Method,'Value'))};
0058 TrainingParams.DelayLearningRate=str2num(get(Handles.Tau_Learning_Rate,'String'));
0059 TrainingParams.WeightLearningRate=str2num(get(Handles.Learning_Rate,'String'));
0060 TrainingParams.MaxError=str2num(get(Handles.Max_Error,'String'));
0061 TrainingParams.NumericalGradient=get(Handles.Numerical_Gradient,'Value');
0062 TrainingParams.GradientStep=1e-5;
0063 TrainingParams.NoiseLevel=0;
0064 TrainingParams.DelayEnable=get(Handles.Delay_Enable,'Value');
0065 TrainingParams.MinDelay=0;
0066 TrainingParams.NumEpochs=str2num(get(Handles.Num_Epochs,'String'));
0067 TrainingParams.FromGUI=1;
0068 TrainingParams.MakeMovie=0;
0069 TrainingParams.Handles=Handles;
0070
0071 TrainingParams.DisplayFrequency=str2num(get(Handles.Display_Frequency,'String'));
0072 TrainingParams.TestingFrequency=str2num(get(Handles.Testing_Frequency,'String'));
0073 elseif nargin==2 && ischar(varargin{1}) && ishandle(varargin{2})
0074
0075 elseif nargin==1 && ischar(varargin{1})
0076
0077 else
0078
0079 TrainingParams.DataName='Temp';
0080 TrainingParams.Type='None';
0081
0082 TrainingParams.LearningMethod='Online Gradient Descent';
0083 TrainingParams.DelayLearningRate=1e-3;
0084 TrainingParams.WeightLearningRate=5e-7;
0085 TrainingParams.MaxError=1e-2;
0086 TrainingParams.NumericalGradient=0;
0087 TrainingParams.GradientStep=1e-5;
0088 TrainingParams.NoiseLevel=0;
0089 TrainingParams.DelayEnable=0;
0090 TrainingParams.MinDelay=0;
0091 TrainingParams.NumEpochs=5000;
0092 TrainingParams.FromGUI=0;
0093 TrainingParams.MakeMovie=0;
0094 TrainingParams.Handles=[];
0095
0096 TrainingParams.DisplayFrequency=100;
0097 TrainingParams.TestingFrequency=100;
0098 end