Update script.py
Browse files
script.py
CHANGED
|
@@ -8,13 +8,15 @@
|
|
| 8 |
|
| 9 |
'''---compulsory---'''
|
| 10 |
import hoho; hoho.setup() # YOU MUST CALL hoho.setup() BEFORE ANYTHING ELSE
|
|
|
|
|
|
|
| 11 |
from pathlib import Path
|
| 12 |
from tqdm import tqdm
|
| 13 |
import pandas as pd
|
| 14 |
import numpy as np
|
| 15 |
|
| 16 |
|
| 17 |
-
def empty_solution():
|
| 18 |
'''Return a minimal valid solution, i.e. 2 vertices and 1 edge.'''
|
| 19 |
return np.zeros((2,3)), [(0, 1)]
|
| 20 |
|
|
@@ -26,7 +28,9 @@ if __name__ == "__main__":
|
|
| 26 |
print('------------ Now you can do your solution ---------------')
|
| 27 |
solution = []
|
| 28 |
for i, sample in enumerate(tqdm(dataset)):
|
| 29 |
-
|
|
|
|
|
|
|
| 30 |
solution.append({
|
| 31 |
'__key__': sample['__key__'],
|
| 32 |
'wf_vertices': pred_vertices.tolist(),
|
|
|
|
| 8 |
|
| 9 |
'''---compulsory---'''
|
| 10 |
import hoho; hoho.setup() # YOU MUST CALL hoho.setup() BEFORE ANYTHING ELSE
|
| 11 |
+
'''---compulsory---'''
|
| 12 |
+
|
| 13 |
from pathlib import Path
|
| 14 |
from tqdm import tqdm
|
| 15 |
import pandas as pd
|
| 16 |
import numpy as np
|
| 17 |
|
| 18 |
|
| 19 |
+
def empty_solution(sample):
|
| 20 |
'''Return a minimal valid solution, i.e. 2 vertices and 1 edge.'''
|
| 21 |
return np.zeros((2,3)), [(0, 1)]
|
| 22 |
|
|
|
|
| 28 |
print('------------ Now you can do your solution ---------------')
|
| 29 |
solution = []
|
| 30 |
for i, sample in enumerate(tqdm(dataset)):
|
| 31 |
+
# replace this with your solution
|
| 32 |
+
pred_vertices, pred_edges = empty_solution(sample)
|
| 33 |
+
|
| 34 |
solution.append({
|
| 35 |
'__key__': sample['__key__'],
|
| 36 |
'wf_vertices': pred_vertices.tolist(),
|