提交 6226b821 编写于 作者: Y Yu Yang 提交者: GitHub

Merge pull request #1778 from reyoung/feature/refine_nce_layer_2

nce_layer cannot accept neg_distribution
...@@ -4873,7 +4873,7 @@ def nce_layer(input, ...@@ -4873,7 +4873,7 @@ def nce_layer(input,
if neg_distribution is not None: if neg_distribution is not None:
assert isinstance(neg_distribution, collections.Sequence) assert isinstance(neg_distribution, collections.Sequence)
assert len(neg_distribution) == num_classes assert len(neg_distribution) == num_classes
assert sum(neg_distribution) == 1 assert abs(sum(neg_distribution) - 1.0) < 1e-5
if not isinstance(act, BaseActivation): if not isinstance(act, BaseActivation):
raise TypeError() raise TypeError()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册