Geometry-Aware Maximum Likelihood Estimation of Intrinsic Dimension