CostNet: An End-to-End Framework for Goal-Directed Reinforcement Learning