Module: Neuronet::Yin
- Defined in:
- lib/neuronet.rb
Overview
Yin is a network which has its @yin layer initially mirroring @in.
Class Method Summary collapse
Class Method Details
.bless(myself) ⇒ Object
491 492 493 494 495 496 497 498 499 500 501 502 503 |
# File 'lib/neuronet.rb', line 491 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 WONE... mirroring to start. 0.upto(in_length-1) do |index| node = [index] node.connections[index].weight += WONE node.bias += BZERO end return myself end |