def ricker_matrix(width, resolution, n_components):
    centers = np.linspace(0, resolution - 1, n_components)
    D = np.empty((n_components, resolution))
    for i, center in enumerate(centers):
        D[i] = ricker_function(resolution, center, width)
    D /= np.sqrt(np.sum(D ** 2, axis=1))[:, np.newaxis]
    return D
Dictionary of Ricker (Mexican hat) wavelets
dataset/ETHPy150Open scikit-learn/scikit-learn/examples/decomposition/plot_sparse_coding.py/ricker_matrix