コード例 #1
0
ファイル: test_optim.py プロジェクト: mshamalainen/mne-python
def test_tf_mxne():
    """Test convergence of TF-MxNE solver"""
    alpha_space = 10
    alpha_time = 5

    M, G, active_set = _generate_tf_data()

    X_hat, active_set_hat, E = tf_mixed_norm_solver(M, G,
                                alpha_space, alpha_time, maxit=200,
                                tol=1e-8, verbose=True,
                                n_orient=1, tstep=4, wsize=32)

    assert_array_equal(np.where(active_set_hat)[0], active_set)
コード例 #2
0
ファイル: test_optim.py プロジェクト: mshamalainen/mne-python
def test_tf_mxne_vs_mxne():
    """Test equivalence of TF-MxNE (with alpha_time=0) and MxNE"""
    alpha_space = 60
    alpha_time = 0

    M, G, active_set = _generate_tf_data()

    X_hat, active_set_hat, E = tf_mixed_norm_solver(M, G,
                                alpha_space, alpha_time, maxit=200,
                                tol=1e-8, verbose=True, debias=False,
                                n_orient=1, tstep=4, wsize=32)

    # Also run L21 and check that we get the same
    X_hat_l21, _, _ = mixed_norm_solver(M, G, alpha_space, maxit=200,
                            tol=1e-8, verbose=False, n_orient=1,
                            active_set_size=None, debias=False)
    assert_array_almost_equal(X_hat, X_hat_l21, decimal=2)