ViliusLuneckas / brainz

Artificial Neural Network library written in Ruby
MIT License
10 stars 2 forks source link

bug: that is not defined in #teach, since the scope is that of the outer object #3

Open ghost opened 5 years ago

ghost commented 5 years ago

Brainz::Brainz.new.teach { |iteration, error| return self.inspect }

This returns the self of the outer object, hence that is not defined.

LEGACY

2019-08-01 02:16:42 - NoMethodError - undefined method +' for nil:NilClass: 2019-08-01T02:16:42.966514+00:00 app[web.1]: /app/eezee.rb:831:ineval' 2019-08-01T02:16:42.966520+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/brainz-0.2.0/lib/brainz/algorithms/backpropagation.rb:16:in initialize_network' 2019-08-01T02:16:42.966523+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/brainz-0.2.0/lib/brainz/algorithms/backpropagation.rb:5:inupdate' 2019-08-01T02:16:42.966525+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/brainz-0.2.0/lib/brainz/brainz.rb:108:in evaluate' 2019-08-01T02:16:42.966527+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/brainz-0.2.0/lib/brainz/brainz.rb:125:inguess' 2019-08-01T02:16:42.966530+00:00 app[web.1]: /app/eezee.rb:123:in `public_send'

ghost commented 5 years ago

nvm, think the training didn't get called due to a bug in another part of my app (nothing to do with your gem).

Just the error message might want to be more descriptive someday.

Thanks for this gem btw.

ghost commented 5 years ago

@ViliusLuneckas any follow up>?