pub fn grid_search_alignment(
kernel_fn: &dyn Fn(&[f64]) -> KernelMatrix,
target: &KernelMatrix,
params_grid: &[Vec<f64>],
config: &AlignmentOptConfig,
) -> Result<OptimizationResult, AlignmentError>Expand description
Grid search over a discrete set of kernel parameter vectors, returning
the one that maximises alignment with target.
§Arguments
kernel_fn- A closure that maps a parameter vector to aKernelMatrix.target- The target kernel (e.g. built from labels viaKernelMatrix::from_labels).params_grid- The set of parameter vectors to evaluate.config- Search configuration (determines CKA vs KTA).
§Returns
An OptimizationResult with best_params set to the grid vector
achieving the highest alignment.