예제 #1
0
def compression_vs_qr(m, n, q):

    x = np.random.standard_normal(size=(m, n))

    t = timeit.default_timer()
    randcomp.compress(x, q, n_power_iter=0)
    tim_comp = timeit.default_timer() - t

    t = timeit.default_timer()
    np.linalg.qr(x)
    tim_qr = timeit.default_timer() - t

    return tim_comp, tim_qr
예제 #2
0
def compression_vs_qr(m, n, q):

    x = np.random.standard_normal(size=(m, n))

    t = timeit.default_timer()
    randcomp.compress(x, q, n_power_iter=0)
    tim_comp = timeit.default_timer() - t

    t = timeit.default_timer()
    np.linalg.qr(x)
    tim_qr = timeit.default_timer() - t

    return tim_comp, tim_qr
예제 #3
0
def size_timing(m, n, q):

    x = np.random.standard_normal(size=(m, n))

    blockshape = (select_blocksize(m), select_blocksize(n))
    data = from_array(x, blockshape=blockshape)

    t = timeit.default_timer()
    data_comp, _ = randcomp.compress(data, q)
    np.array(data_comp)
    tid = timeit.default_timer() - t

    t = timeit.default_timer()
    randcomp.compress(x, q, n_power_iter=0)
    tim = timeit.default_timer() - t

    return tid, tim
예제 #4
0
def size_timing(m, n, q):

    x = np.random.standard_normal(size=(m, n))

    blockshape = (select_blocksize(m), select_blocksize(n))
    data = from_array(x, blockshape=blockshape)

    t = timeit.default_timer()
    data_comp, _ = randcomp.compress(data, q)
    np.array(data_comp)
    tid = timeit.default_timer() - t

    t = timeit.default_timer()
    randcomp.compress(x, q, n_power_iter=0)
    tim = timeit.default_timer() - t

    return tid, tim