seems to be working but error functions may be incorrect. mean training error actually slowly increases after several epochs