apply-method for neural net + tests
#learn function