Geometric Methods for Sampling, Optimisation, Inference and Adaptive Agents