Adaptive Geometric Learning for Optimization and Sampling