add implementation for calculating back-propagation errors