Home > TNNT_1_07 > FrontEnd > get_training_params.m

get_training_params

PURPOSE ^

GET_TRAINING_PARAMS returns a structure with training specific information

SYNOPSIS ^

function TrainingParams=get_training_params(varargin)

DESCRIPTION ^

GET_TRAINING_PARAMS returns a structure with training specific information

Description:
Returns the TrainingParams structure that contains information for 
training a theta neuron network, such as the learning rates.

Syntax:
TrainingParams=GET_TRAINING_PARAMS;
TrainingParams=GET_TRAINING_PARAMS('Example.mat',[Handles]);
TrainingParams=GET_TRAINING_PARAMS(Handles);

Input Parameters:
o Handles: An object of the theta neuron network class
o ts: A cell array of length NumNeurons containing in each cell an array 
    of length r_j of neuron j's output spike times.
o Neuron1: Neuron index for the input neuron
o Neuron2: Neuron index for the output neuron

Output Parameters:
o TrainingParams: A structure that contains information for training a 
    theta neuron network, such as the learning rates. The structure may
    also contain a Handles structure for referencing to and from the theta
    neuron training GUI.

Example:
>> TrainingParams=get_training_params;

See also theta_neuron_network

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function TrainingParams=get_training_params(varargin)
0002 %GET_TRAINING_PARAMS returns a structure with training specific information
0003 %
0004 %Description:
0005 %Returns the TrainingParams structure that contains information for
0006 %training a theta neuron network, such as the learning rates.
0007 %
0008 %Syntax:
0009 %TrainingParams=GET_TRAINING_PARAMS;
0010 %TrainingParams=GET_TRAINING_PARAMS('Example.mat',[Handles]);
0011 %TrainingParams=GET_TRAINING_PARAMS(Handles);
0012 %
0013 %Input Parameters:
0014 %o Handles: An object of the theta neuron network class
0015 %o ts: A cell array of length NumNeurons containing in each cell an array
0016 %    of length r_j of neuron j's output spike times.
0017 %o Neuron1: Neuron index for the input neuron
0018 %o Neuron2: Neuron index for the output neuron
0019 %
0020 %Output Parameters:
0021 %o TrainingParams: A structure that contains information for training a
0022 %    theta neuron network, such as the learning rates. The structure may
0023 %    also contain a Handles structure for referencing to and from the theta
0024 %    neuron training GUI.
0025 %
0026 %Example:
0027 %>> TrainingParams=get_training_params;
0028 %
0029 %See also theta_neuron_network
0030 
0031 %Copyright (C) 2008 Sam McKennoch <Samuel.McKennoch@loria.fr>
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     %Get info from GUI
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     %TODO: Get info from file and set information to GUI
0075 elseif nargin==1 && ischar(varargin{1})
0076     %TODO: Get info from file
0077 else
0078     %Use default values
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

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