Class: FFNN

Inherits:
NN
  • Object
show all
Defined in:
lib/neuroevo/nn.rb

Instance Attribute Summary

Attributes inherited from NN

#act_fn, #layers, #state, #struct

Instance Method Summary collapse

Methods inherited from NN

act_fn, #activate, #bias, #deep_reset, #init_random, #initialize, #layer_col_sizes, #layer_shapes, lecun_hyperbolic, #load_weights, logistic, #nlayers, #nneurs, #nweights, #nweights_per_layer, #out, #reset_state, sigmoid, #sym, #weights

Constructor Details

This class inherits a constructor from NN

Instance Method Details

#activate_layer(i) ⇒ Object


181
182
183
# File 'lib/neuroevo/nn.rb', line 181

def activate_layer i
  act_fn.call( state[i].dot layers[i] )
end

#layer_row_sizesObject

Feed Forward Neural Network


176
177
178
179
# File 'lib/neuroevo/nn.rb', line 176

def layer_row_sizes
  # inputs (or previous-layer activations) and bias
  @layer_row_sizes ||= struct.each_cons(2).collect {|prev, curr| prev+1}
end