Skip to content

Instantly share code, notes, and snippets.

@QB3
QB3 / uot.py
Last active July 11, 2023 20:49
import numpy as np
import skglm
import celer
import sklearn.linear_model
import scipy.sparse as sp
def get_X_lasso(n, m):
""" Construction of design matrix H
@QB3
QB3 / discrete_cmap.py
Created December 18, 2020 14:29 — forked from jakevdp/discrete_cmap.py
Small utility to create a discrete matplotlib colormap
# By Jake VanderPlas
# License: BSD-style
import matplotlib.pyplot as plt
import numpy as np
def discrete_cmap(N, base_cmap=None):
"""Create an N-bin discrete colormap from the specified input map"""
"""
================================================================
Compute sparse inverse solution with mixed norm: MxNE and irMxNE
================================================================
Runs an (ir)MxNE (L1/L2 [1]_ or L0.5/L2 [2]_ mixed norm) inverse solver.
L0.5/L2 is done with irMxNE which allows for sparser
source estimates with less amplitude bias due to the non-convexity
of the L0.5/L2 mixed norm penalty.
"""
================================================================
Benchmark pure python vs blas Block Coordinate Descent
================================================================
References
----------
.. [1] Gramfort A., Kowalski M. and Hamalainen, M.
"Mixed-norm estimates for the M/EEG inverse problem using accelerated
gradient methods", Physics in Medicine and Biology, 2012.
"""
==============================
Generate simulated evoked data
==============================
"""
# Author: Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
@QB3
QB3 / plot_camcan_example.py
Created October 24, 2018 15:52 — forked from massich/plot_camcan_example.py
mne camcan tutorial from parietal's mne assingment
# -*- coding: utf-8 -*-
"""
========================
cam-CAN tutorial dataset
========================
"""