optimizations for main hyperparam derivs: cache distance pairs and exploit symmetry
efficient sparse gradient computation for CSFIC models