Module: Neuronet::Arrayable

Included in:
Deep, FeedForward, InputLayer, Layer, MLP, MiddleLayer, OutputLayer, Perceptron
Defined in:
lib/neuronet/arrayable.rb

Overview

Arrayable avoids explicit ‘to_a` calls for common Array methods.

Instance Method Summary collapse

Instance Method Details

#[](index) ⇒ Object



8
# File 'lib/neuronet/arrayable.rb', line 8

def [](index) = to_a[index]

#each(&blk) ⇒ Object



6
# File 'lib/neuronet/arrayable.rb', line 6

def each(&blk) = to_a.each { blk[it] }

#each_with_index(&blk) ⇒ Object



7
# File 'lib/neuronet/arrayable.rb', line 7

def each_with_index(&blk) = to_a.each_with_index { |n, i| blk[n, i] }

#mapObject



9
# File 'lib/neuronet/arrayable.rb', line 9

def map(&) = to_a.map(&)

#reverseObject



11
# File 'lib/neuronet/arrayable.rb', line 11

def reverse = to_a.reverse

#sizeObject



10
# File 'lib/neuronet/arrayable.rb', line 10

def size = to_a.size