Skip to content

Commit 5ea8479

Browse files
author
donglaiw
committed
make sure inference block result are non-negative
1 parent e2acbe3 commit 5ea8479

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

connectomics/engine/trainer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ def test(self):
235235
st = (np.array(st) *
236236
np.array([1]+output_scale)).astype(int).tolist()
237237
out_block = output[idx]
238+
# hack it to make it positive for better weighted average
239+
out_block[out_block < 0] = 0
238240
if result[st[0]].ndim - out_block.ndim == 1: # 2d model
239241
out_block = out_block[:, np.newaxis, :]
240242

0 commit comments

Comments
 (0)