开发者

Generalized Hebbian Algorithm in ruby or python

Have you a Generalized Hebbian Algorithm written in ruby 开发者_如何学运维or python? I have it implemented from this wiki article, but it computes crazy large numbers.

This is the formula in ruby:

@alpha * out[j] * (input[i] - out[j] * sum(@koef.times.map{|k| @weights[k][i] * out[k]})) = -2.97697080169534e+15

Is this wrong? thx


As it seems, you have out[j] once too much. Try:

@alpha*out[j]*(input[i] - sum(@koef.times.map{|k| @weights[k][i] * out[k]}))

Also, notice that alpha should be decreasing with time.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜