Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dcsim/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,11 @@ def train_10_fold_balanced():
avg_recall = 0.
avg_precision = 0.
avg_f1_score = 0.
fout = open('result/10_fold_balanced.txt', 'w')
if os.path.exists('result') is not True:
os.mkdir("result")
if os.path.exists("10_fold_balanced") is not True:
os.mkdir("10_fold_balanced")
fout = open('result/10_fold_balanced.txt', 'w')
for train_idx, test_idx in skf.split(X, y):
print ('*' * 40 + str(fold_index) + '*' * 40)
fold_path = os.path.join("10_fold_balanced", str(fold_index))
Expand Down Expand Up @@ -513,7 +513,7 @@ def predict_on_full_dataset():
file_path = "../dataset/g4_128.npy"
dataset = np.load(open(file_path, 'r'))
X, y = np.array(dataset['X']), np.array(dataset['y'], dtype=np.int)

t_beg = time.clock()
saver = tf.train.Saver()
sess = tf.InteractiveSession()
Expand Down Expand Up @@ -546,7 +546,7 @@ def predict_on_full_dataset():
test_X_left = np.array(test_X_left)
test_X_right = np.array(test_X_right)
test_Y = np.array(test_Y, dtype=np.float32)


overall_predict_Y = []
for start, end in zip(range(0, np.shape(test_X_left)[0], batch_size),
Expand All @@ -567,4 +567,4 @@ def predict_on_full_dataset():
train_10_fold_balanced()
st = time.time()
predict_on_full_dataset()
print "Predict time on the full dataset: ", time.time() - st
print "Predict time on the full dataset: ", time.time() - st