Browse Source

Update tests.

v0.2.x
jajupmochi 5 years ago
parent
commit
2248a1308e
3 changed files with 16 additions and 2 deletions
  1. +0
    -0
      gklearn/ged/__init__.py
  2. +2
    -2
      gklearn/preimage/experiments/xp_median_preimage.py
  3. +14
    -0
      gklearn/tests/test_graph_kernels.py

+ 0
- 0
gklearn/ged/__init__.py View File


+ 2
- 2
gklearn/preimage/experiments/xp_median_preimage.py View File

@@ -92,7 +92,7 @@ def xp_median_preimage_9_2():
'epsilon_ec': 0.1,
'verbose': 2}
kernel_options = {'name': 'PathUpToH',
'depth': 2, #
'depth': 9, #
'k_func': 'MinMax', #
'compute_method': 'trie',
'parallel': 'imap_unordered',
@@ -217,7 +217,7 @@ def xp_median_preimage_8_2():
'epsilon_ec': 0.1,
'verbose': 2}
kernel_options = {'name': 'PathUpToH',
'depth': 2, #
'depth': 7, #
'k_func': 'MinMax', #
'compute_method': 'trie',
'parallel': 'imap_unordered',


+ 14
- 0
gklearn/tests/test_graph_kernels.py View File

@@ -162,6 +162,11 @@ def test_ShortestPath(ds_name, parallel):
node_kernels=sub_kernels)
gram_matrix, run_time = graph_kernel.compute(dataset.graphs,
parallel=parallel, n_jobs=multiprocessing.cpu_count(), verbose=True)
kernel_list, run_time = graph_kernel.compute(dataset.graphs[0], dataset.graphs[1:],
parallel=parallel, n_jobs=multiprocessing.cpu_count(), verbose=True)
kernel, run_time = graph_kernel.compute(dataset.graphs[0], dataset.graphs[1],
parallel=parallel, n_jobs=multiprocessing.cpu_count(), verbose=True)

except Exception as exception:
assert False, exception

@@ -190,6 +195,11 @@ def test_StructuralSP(ds_name, parallel):
edge_kernels=sub_kernels)
gram_matrix, run_time = graph_kernel.compute(dataset.graphs,
parallel=parallel, n_jobs=multiprocessing.cpu_count(), verbose=True)
kernel_list, run_time = graph_kernel.compute(dataset.graphs[0], dataset.graphs[1:],
parallel=parallel, n_jobs=multiprocessing.cpu_count(), verbose=True)
kernel, run_time = graph_kernel.compute(dataset.graphs[0], dataset.graphs[1],
parallel=parallel, n_jobs=multiprocessing.cpu_count(), verbose=True)

except Exception as exception:
assert False, exception

@@ -213,6 +223,10 @@ def test_PathUpToH(ds_name, parallel, k_func, compute_method):
depth=2, k_func=k_func, compute_method=compute_method)
gram_matrix, run_time = graph_kernel.compute(dataset.graphs,
parallel=parallel, n_jobs=multiprocessing.cpu_count(), verbose=True)
kernel_list, run_time = graph_kernel.compute(dataset.graphs[0], dataset.graphs[1:],
parallel=parallel, n_jobs=multiprocessing.cpu_count(), verbose=True)
kernel, run_time = graph_kernel.compute(dataset.graphs[0], dataset.graphs[1],
parallel=parallel, n_jobs=multiprocessing.cpu_count(), verbose=True)
except Exception as exception:
assert False, exception


Loading…
Cancel
Save