|
@@ -1,5 +1,6 @@
|
|
import ast
|
|
import ast
|
|
import os
|
|
import os
|
|
|
|
+import random
|
|
|
|
|
|
from graph.common.nodetype import *
|
|
from graph.common.nodetype import *
|
|
from graph.common.graphtype import *
|
|
from graph.common.graphtype import *
|
|
@@ -64,6 +65,7 @@ def gen_graph_to_txt():
|
|
path_out_train = CUR_PATH + "/../../data/traindata/train/" + str(kind) + ".txt"
|
|
path_out_train = CUR_PATH + "/../../data/traindata/train/" + str(kind) + ".txt"
|
|
path_out_test = CUR_PATH + "/../../data/traindata/test/" + str(kind) + ".txt"
|
|
path_out_test = CUR_PATH + "/../../data/traindata/test/" + str(kind) + ".txt"
|
|
file_path_list = walk_files(path_ori + "/" + kind)
|
|
file_path_list = walk_files(path_ori + "/" + kind)
|
|
|
|
+ random.shuffle(file_path_list)
|
|
lens = int(len(file_path_list) / 4 * 3)
|
|
lens = int(len(file_path_list) / 4 * 3)
|
|
with open(path_out_train, 'w') as file:
|
|
with open(path_out_train, 'w') as file:
|
|
for file_path in file_path_list[:lens]:
|
|
for file_path in file_path_list[:lens]:
|