Module: Neuronet::Yin

Defined in:
lib/neuronet.rb

Overview

sets @yin to initially mirror @in

Class Method Summary collapse

Class Method Details

.bless(myself) ⇒ Object



369
370
371
372
373
374
375
376
377
378
379
380
381
# File 'lib/neuronet.rb', line 369

def self.bless(myself)
  yin = myself.yin
  if yin.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 = yin[index]
    node.connections[index].weight = 1.0
    node.bias = -0.5
  end
  return myself
end