brainmass.objectives.fcd_ks#
- brainmass.objectives.fcd_ks(window_size=30, step_size=5, midpoints=None, bw_method=None, n_diag=1)[source]#
Build a Kolmogorov-Smirnov FCD-distribution loss.
Like
fcd_wasserstein()but using theks_distance()statistic between the two FCD off-diagonal distributions. The KS statistic is the common literature metric for FCD comparison, but it is non-smooth (a supremum); preferfcd_wasserstein()when the loss drives a gradient optimiser, and use this for evaluation / reporting.- Parameters:
window_size (int) – Sliding-window length and stride (in samples) for
braintools.metric.functional_connectivity_dynamics().step_size (int) – Sliding-window length and stride (in samples) for
braintools.metric.functional_connectivity_dynamics().midpoints (array, optional) – FCD-value evaluation grid (default 100 points on
[-0.99, 0.99]).bw_method (optional) – KDE bandwidth forwarded to
fcd_distribution().n_diag (int, default 1) – Upper-triangle diagonal offset.
- Returns:
loss(prediction, target) -> scalarKS distance between the two FCD distributions (a quantity to minimise;0on identity).- Return type:
callable
See also
fcd_wassersteinthe smooth, gradient-friendly counterpart.