Update Cost Function

Update Cost Function in Train
Update Test script
Still need to fix test cost function