This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import time | |
def estimate_prob_bob_win(n_situations, seed=None, timeout=10): | |
rng = np.random.default_rng(seed) | |
bob_wins = 0 | |
n_games = 0 | |
t_start = time.time() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import warnings | |
from scipy import sparse | |
from scipy.stats import norm as gaussian | |
def make_gaussians(grid, n_hists, loc=None, scale=None, normed=True, | |
mass=None): | |
"""Generate random gaussian histograms. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyvista as pv | |
import numpy as np | |
make_gif = True | |
# increase n_points for a higher resolution | |
n_points = 100 | |
xmin, xmax = -1.2, 1.2 | |
bounds = 1.25 * np.array([xmin, xmax, xmin, xmax, 0., 0.]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
================================================================ | |
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. |