Cost function for Feedforfard nn has been implemented