Fix cost bug; Implement MLP base trainer tests