コード例 #1
0
ファイル: run_tests.py プロジェクト: zpzim/SCAMP
    input_sizes_to_test = args.input_sizes

if args.matrix_sizes is not None:
    matrix_sizes_to_test = args.matrix_sizes

if args.thresholds is not None:
    thresholds_to_test = args.thresholds

if executable == 'pyscamp':
    import pyscamp as mp
    if args.tile_sizes:
        print('Warning: ignoring tile_sizes during pyscamp execution')
    tile_sizes_to_test = [0]

gpu_enabled = False
if args.force_gpu or (executable == 'pyscamp' and mp.gpu_supported()):
    gpu_enabled = True

index_match_ratio = 0.001
matrix_match_ratio = 0.001

vector_match_epsilon_SUM = 0.001
vector_match_epsilon_1NN = 0.001

matrix_match_epsilon = 0.001


def generate_input_arrays(input_sizes):
    arrs = []
    for s in input_sizes:
        arrs.append(np.random.randn(s))
コード例 #2
0
    print("SUM Self join fail")

dist = mp.abjoin_sum(arr, arr2, 1024, threshold=0.90, pearson=True)
dist = dist.reshape((len(dist), 1))
vdist = reduce_sum_thresh(dm_ab, 0.90)

if compare_vectors(vdist, np.array(dist)):
    print("SUM AB join pass")
else:
    failed = True
    print("SUM AB join fail")

dist = mp.selfjoin(arr, 1024, threads=1)
dist = mp.selfjoin(arr, 1024, threads=2)

if mp.gpu_supported():
    print('GPUs Supported')
    # TODO(zpzim): add a correctness check here once we have a test for that
    x = mp.selfjoin_knn(arr, 1024, 5, threshold=0.95, pearson=True)
    # TODO(zpzim): add a correctness check here once we have a test for that
    matrix = mp.abjoin_matrix(arr,
                              arr2,
                              1024,
                              threshold=0.125,
                              mwidth=10,
                              mheight=5,
                              pearson=True)

if failed:
    exit(1)