Inverse Reinforcement Learning with Locally Consistent Reward Functions