Skip to content

Commit 2b98a4e

Browse files
author
Han Wang
committed
protect the descrpt to 1e-2 rather than set to 1
1 parent 86c75da commit 2b98a4e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

source/train/DescrptSeA.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ def _compute_dstats_sys_smth (self,
293293

294294
def _compute_std (self,sumv2, sumv, sumn) :
295295
val = np.sqrt(sumv2/sumn - np.multiply(sumv/sumn, sumv/sumn))
296-
if val == 0:
297-
val = 1
296+
if np.abs(val) < 1e-2:
297+
val = 1e-2
298298
return val
299299

300300

source/train/DescrptSeR.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ def _compute_dstats_sys_se_r (self,
241241

242242
def _compute_std (self,sumv2, sumv, sumn) :
243243
val = np.sqrt(sumv2/sumn - np.multiply(sumv/sumn, sumv/sumn))
244-
if val == 0:
245-
val = 1
244+
if np.abs(val) < 1e-2:
245+
val = 1e-2
246246
return val
247247

248248

0 commit comments

Comments
 (0)