Beyond Exponentially Discounted Sum: Automatic Learning of Return Function