Mass Regularized Simplicial Median Shape(MRSMS)¶
-
medianshape.core.median.median(points, simplices, subsimplices, input_currents, lambda_, mu=0.001, w=[], v=[], cons=[], alphas=None)[source]¶ Accepts simplicial settings, input currents, multiscale factor(\(\lambda\)) and mass regularizing factor(\(\mu\)). Returns median shape and flat norm decomposition in the given simplicial settings. Let K be an underlying simplicial complex of dimension q.
Parameters: - points (float) – points in K.
- simplices (int) – (p+1)-simplices in K, an array of dimension (nx(p+1)) where \(p+1 \leq q\) and n is the number of p+1-simplices in K.
- subsimplices (int) – p-simplices in K, an array of dimension (mxp) where \(p \leq q\) and m is the number of p-simplice in K.
- input_currents (int) – input currents, an array of dimension kxm where k is the number of input currents.
- lambda (float) – multiscale factor.
- mu (float) – Mass regularizing factor (no mass regularization when set to 0).
- w (float) – a vector of subsimplices volumes.
- v (float) – a vector of simplices volumes.
- cons (int) – a constraint matrix A of dimension kmx(2m+k(2m+2n)).
- alphas (float) – Weights for input currents if none, \(\alpha_{i}=\frac{1}{k}\).
Returns: t, q, r, objective_value – median current, p-chains, (p+1)-chains for median shape decompostion, minimum value of the objective function.
Return type: int, int, int, float.
-
medianshape.core.median.get_lp_inputs(points, simplices, subsimplices, k_currents, w=[], v=[], b_matrix=[], cons=[])[source]¶ Accepts simplicial settings along with number of currents and returns inputs of median shape LP such as simplicial volumes, boundary matrix and LP contraint matrix so that we can run multiple experiments in the same LP settings without computational repetition such as computing median shape for diffent values of mass regularization factor lambda.
Parameters: - points (float) – points in K.
- simplices (int) – (p+1)-simplices in K, an array of dimension (nx(p+1)). where \(p+1 \leq q\) and n is the number of p+1-simplices in K.
- subsimplices (int) – p-simplices in K, an array of dimension (mxp) where \(p \leq q\) and m is the number of p-simplice in K.
- k_currents (int) – number of input currents where k is the number of input currents.
- w (float) – a vector of subsimplices volumes.
- v (float) – a vector of simplicial volumes.
- b_matrix (int) – a boundary matrix representing the boundary operator \(\partial_{p+1}\) of K.
- cons (int) – a constraint matrix A of dimension kmx(2m+k(2m+2n)).
Returns: t, q, r, objective_value – median current, p-chains, p+1-chains for median shape decompostion, minimum value of the objective function.
Return type: int, int, int, float.