class Phren::Layer
Attributes
id[R]
length[R]
neurons[R]
Public Class Methods
new(length, id)
click to toggle source
# File lib/layer.rb, line 7 def initialize(length, id) @length = length @id = id # num of layer starting from 0. if it's negative neurons are bias @neurons = Array.new(@length) { |i| Neuron.new(@id < 0 ? 1 : 0,[@id, i]) } end