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.
精彩评论