Module: Neuronet::Yin
- Defined in:
- lib/neuronet.rb
Overview
Yin is a network wich has its @yin layer initially mirroring @in.
Class Method Summary collapse
Class Method Details
.bless(myself) ⇒ Object
488 489 490 491 492 493 494 495 496 497 498 499 500 |
# File 'lib/neuronet.rb', line 488 def self.bless(myself) = myself. if .length < (in_length = myself.in.length) raise "First hidden layer, yin, needs to have at least the same length as input" end # connections from yin[i] to in[i] are 1... mirroring to start. 0.upto(in_length-1) do |index| node = [index] node.connections[index].weight = 1.0 node.bias = -0.5 end return myself end |