コード例 #1
0
ファイル: test_l1_ls.py プロジェクト: vishalbelsare/l1-ls.py
def test_high_accuracy_nonneg():
    [x, status, hist] = l1ls_nonneg(A, y, lmbda, tar_gap=rel_tol / 10)
    assert_allclose(x, answer_high_accuracy_nonneg, atol=1e-5)
    expect(hist.shape).to_equal((15, 5))
    expect(status).to_equal('Solved')
コード例 #2
0
ファイル: test_l1_ls.py プロジェクト: vishalbelsare/l1-ls.py
def test_small_example_sparse_nonneg():
    [x, status, hist] = l1ls_nonneg(S.csr_matrix(A), y, lmbda, tar_gap=rel_tol)
    assert_allclose(x, answer_nonneg, atol=1e-5)
    expect(hist.shape).to_equal((12, 5))
    expect(status).to_equal('Solved')
コード例 #3
0
ファイル: test_l1_ls.py プロジェクト: vishalbelsare/l1-ls.py
def test_small_example_nonneg_zero():
    [x, status, hist] = l1ls_nonneg(A,
                                    np.zeros_like(y),
                                    lmbda,
                                    tar_gap=rel_tol)
    expect(status).to_equal('Failed')
コード例 #4
0
def test_high_accuracy_nonneg():
    [x, status, hist] = l1ls_nonneg(A, y, lmbda, tar_gap=rel_tol / 10)
    assert_allclose(x, answer_high_accuracy_nonneg, atol=1e-5)
    expect(hist.shape).to_equal((15, 5))
    expect(status).to_equal("Solved")
コード例 #5
0
def test_small_example_sparse_nonneg():
    [x, status, hist] = l1ls_nonneg(S.csr_matrix(A), y, lmbda, tar_gap=rel_tol)
    assert_allclose(x, answer_nonneg, atol=1e-5)
    expect(hist.shape).to_equal((12, 5))
    expect(status).to_equal("Solved")
コード例 #6
0
def test_small_example_nonneg_zero():
    [x, status, hist] = l1ls_nonneg(A, np.zeros_like(y), lmbda, tar_gap=rel_tol)
    expect(status).to_equal("Failed")