www.gusucode.com > mbcmodels 工具箱 matlab 源码程序 > mbcmodels/@xregnnet/get.m
function Value = get(nn, Property, varargin) %GET % % Value = get(nn, Property); % PropList = get(nn); % Copyright 2000-2007 The MathWorks, Inc. and Ford Global Technologies, Inc. if nargin == 1 Value = [{'hiddenlayers','algorithm','learningrate','momentumconstant',... 'maxiter','mu','mu_inc','mu_dec'}' get(nn.xregmodel);fieldnames(nn.param)]; else switch lower(Property) case 'hiddenlayers' Value=nn.param.numlayers-1; case 'hiddenneurons' for n=1:nn.param.numlayers-1 Value(n)=nn.param.layers{n}.dimensions; end Value=Value(:)'; case 'algorithm' Value = nn.param.trainfcn; case 'learningrate' Value = nn.param.trainparam.lr; case 'momentumconstant' Value = nn.param.trainparam.mc; case 'maxiter' Value = nn.param.trainparam.epochs; case 'mu' Value = nn.param.trainparam.mu; case 'mu_inc' Value = nn.param.trainparam.mu_inc; case 'mu_dec' Value = nn.param.trainparam.mu_dec; otherwise try Value=get(nn.xregmodel,Property); catch try Value = nn.param.(Property); catch error(message('mbc:xregnnet:InvalidProperty', Property)); end end end end