def _receiver_validator(weights, rec_wcounts, cat_wcounts):
"""
Validate the receiver weights, and make sure it sums to
category window counts.
:param weights:
:param rec_wcounts:
:param cat_wcounts:
:return:
"""
wsum = 0
for chan, chan_weight in weights.iteritems():
nwin = rec_wcounts[chan]
wsum += chan_weight * nwin
print("Summation of (rec_weights * rec_nwins): %.2f" % wsum)
if not np.isclose(wsum, cat_wcounts):
raise ValueError("receiver validator fails: %f, %f" %
(wsum, cat_wcounts))
window_weights.py 文件源码
python
阅读 36
收藏 0
点赞 0
评论 0
评论列表
文章目录