added option to show cost during validation training