Code for the paper "Derivatives with Respect to Metrics and Applications: Subgradient Marching Algorithm"