Metric Learning for Invariant Feature Generation in Reinforcement Learning