Deep Visual Odometry With Adaptive Memory