Skip to content

Commit ceb0ca3

Browse files
authored
Merge pull request #36 from francoep/patch-7
Added cleaner support if all affinities are <=0
2 parents 279f215 + 9d6b7b2 commit ceb0ca3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: train.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,12 @@ def evaluate_test_net(test_net, n_tests, n_rotations):
230230
if result.y_aff and result.y_predaff:
231231
y_predaff_true = np.array(result.y_predaff)[np.array(result.y_aff)>0]#filter_actives(result.y_predaff, result.y_true)
232232
y_aff_true = np.array(result.y_aff)[np.array(result.y_aff)>0]#filter_actives(result.y_aff, result.y_true)
233-
234-
result.rmsd = np.sqrt(sklearn.metrics.mean_squared_error(y_aff_true, y_predaff_true))
233+
234+
if y_aff_true.shape[0] == 0:
235+
print("Warning: no true affinities, setting rmsd=-999.0")
236+
result.rmsd=-999.0
237+
else:
238+
result.rmsd = np.sqrt(sklearn.metrics.mean_squared_error(y_aff_true, y_predaff_true))
235239

236240
if any(rmsd_pred):
237241
result.rmsd_rmse = np.sqrt(sklearn.metrics.mean_squared_error(result.rmsd_pred,result.rmsd_true))

0 commit comments

Comments
 (0)