问题描述
因此,我目前正在尝试使用遗传算法进行训练和采用S型激活函数来实现我的第一个NN.一切都很好,但是我不确定重量必须在什么范围内.我已经搜索了一些有关该问题的信息,但是没有运气.如何选择NN中权重的范围?它取决于什么?
So I am currently trying to implement my first NN with a genetic algorithm for training and a sigmoid activation function. It's all good but I'm not quite sure in what ranges the weights must be. I've searched some about the question but with no luck. How does one choose the ranges of the weights in a NN? What does it depend on?
推荐答案
权重可以看作是您要使用GA/NN方法解决的问题的固有属性;这些值没有一般的最佳值,因此最好在固定其他参数的情况下研究不同的体重跨度(w.r.t.训练集).
The weights can be seen as an intrinsic property of the problem you're trying to solve using the GA/NN approach; there's no general best value fo these, so you're best off studying different weight spans (w.r.t. training sets) with other parameters fixed.
例如,研究参数weightSpan的不同设置
E.g., study different settings for parameter weightSpan in
weights \in [-weightSpan/2, weightSpan/2],
,让您的初始染色体用此范围内的随机值描述权重.您的挤压函数(S型)用于将NN响应分级到[0,1]范围.
and let your initial chromosomes describe weights with randomized values in this range. Your squashing function (sigmoid) is used to grade the NN response to the range [0, 1].
找到适当的权重跨度,就像设置隐蔽层数的值一样,是针对特定问题的测试过程. (天下没有免费的午餐").
Finding an appropriate weight span is, much like setting a value of number of hidden layer, a process if problem-specific testing. ("There is no free lunch").
我想补充一点,研究不同重量跨度的最简单方法可能是设置固定的重量跨度,例如[-1,1],并研究压扁函数(S型)中的压扁常数.也就是说,在乙状结肠中研究常数c
的不同(非负)值
I thought I'd add that the easiest way to study different weight spans is probably to set a fixed weight span, say [-1, 1], and study the squashing constant in your squashing function (sigmoid). I.e., study different (non-negative) values of constant c
in your sigmoid
σ(s) = 1 / (1 + e^(-c*s))
这篇关于在NN中计算权重的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!