mushi.utils.fold

fold(x)[source]

transform SFS to folded SFS.

Parameters

func – loss function name from loss_functions module

Examples

>>> from mushi import utils
>>> import jax.numpy as np
>>> sfs = np.array([1000, 100, 10])
>>> utils.fold(sfs)
DeviceArray([1010,  100], dtype=int64)
Return type

ndarray