示例#1
0
def test_logsumexp_truncated_diverging_gemoetric_series():
    """test logsumexp() for a truncated, non-converging 10^4 element geometric series"""
    data = np.arange(10000).astype(np.float64)
    assert_true(np.abs(logsumexp(data) - 9999.4586751453862) < 1.0E-15)
示例#2
0
def test_logsumexp_truncated_diverging_gemoetric_series():
    """test logsumexp() for a truncated, non-converging 10^4 element geometric series"""
    data = np.arange(10000).astype(np.float64)
    assert_true(np.abs(logsumexp(data) - 9999.4586751453862) < 1.0E-15)
示例#3
0
def test_logsumexp_converged_geometric_series():
    """test logsumexp() for a converging 10^4 element geometric series"""
    data = np.arange(10000).astype(np.float64)
    assert_true(np.abs(logsumexp(-data) - 0.45867514538708193) < 1.0E-15)
示例#4
0
def test_logsumexp_converged_geometric_series():
    """test logsumexp() for a converging 10^4 element geometric series"""
    data = np.arange(10000).astype(np.float64)
    assert_true(np.abs(logsumexp(-data) - 0.45867514538708193) < 1.0E-15)