概述
MATLAB是一种面向对象的语言,所以你创建了一个神经网络net的object, 下面我教给你如何修改参数。你明白原理以后,可以修改任意参数:
首先我们运行一个简单的神经网络例程:
[x,t] = simplefit_dataset;
net = feedforwardnet(10) %我故意把封号去掉,想看一下net到底是什么
结果如下:
net =
Neural Network
name: 'Feed-Forward Neural Network'
efficiency: .cacheDelayedInputs, .flattenTime,
.memoryReduction
userdata: (your custom info)
dimensions:
numInputs: 1
numLayers: 2
numOutputs: 1
numInputDelays: 0
numLayerDelays: 0
numFeedbackDelays: 0
numWeightElements: 10
sampleTime: 1
connections:
biasConnect: [1; 1]
inputConnect: [1; 0]
layerConnect: [0 0; 1 0]
outputConnect: [0 1]
subobjects:
inputs: {1x1 cell array of 1 input}
layers: {2x1 cell array of 2 layers}
outputs: {1x2 cell array of 1 output}
biases: {2x1 cell array of 2 biases}
inputWeights: {2x1 cell array of 1 weight}
layerWeights: {2x2 cell array of 1 weight}
functions:
adaptFcn: 'adaptwb'
adaptParam: (none)
derivFcn: 'defaultderiv'
divideFcn: 'dividerand'
divideParam: .trainRatio, .valRatio, .testRatio
divideMode: 'sample'
initFcn: 'initlay'
performFcn: 'mse'
performParam: .regularization, .normalization, .squaredWeighting
plotFcns: {'plotperform', plottrainstate, ploterrhist,
plotregression}
plotParams: {1x4 cell array of 4 params}
trainFcn: 'trainlm'
trainParam: .showWindow, .showCommandLine, .show, .epochs,
.time, .goal, .min_grad, .max_fail, .mu, .mu_dec,
.mu_inc, .mu_max
weight and bias values:
IW: {2x1 cell} containing 1 input weight matrix
LW: {2x2 cell} containing 1 layer weight matrix
b: {2x1 cell} containing 2 bias vectors
methods:
adapt: Learn while in continuous use
configure: Configure inputs & outputs
gensim: Generate Simulink model
init: Initialize weights & biases
perform: Calculate performance
sim: Evaluate network outputs given inputs
train: Train network with examples
view: View diagram
unconfigure: Unconfigure inputs & outputs
evaluate: outputs = net(inputs)
>>
现在明白了么?一个object,通常有属性(properties)和方法(methods), 这里的functions类似于属性,所以你可以这样修改你的目标(根据需要修改数值):
net.trainParam.epochs = 1000; %训练次数
net.trainParam.show = 10; %显示次数
net.trainParam.goal = 0.1; %训练目标
.....
然后调用train函数即可
最后
以上就是高高微笑为你收集整理的epoch如何设置_matlab神经网络训练时,如何选择迭代次数的问题的全部内容,希望文章能够帮你解决epoch如何设置_matlab神经网络训练时,如何选择迭代次数的问题所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复