提交 59c8a64f authored 作者: AdeB's avatar AdeB

Reorder arguments of h_softmax

上级 c8bc4549
......@@ -2052,11 +2052,10 @@ def relu(x, alpha=0):
return f1 * x + f2 * abs(x)
def h_softmax(x, batch_size, n_outputs, W1, b1, W2, b2,
n_classes, n_outputs_per_class, target=None):
def h_softmax(x, batch_size, n_outputs, n_classes, n_outputs_per_class,
W1, b1, W2, b2, target=None):
""" Two-level hierarchical softmax.
Outputs are grouped in sqrt(n_outputs) classes.
The architecture is composed of two softmax layers: the first predicts the
class of the input x while the second predicts the output of the input x in
the predicted class.
......
......@@ -1489,12 +1489,12 @@ def test_h_softmax():
y = tensor.ivector('y')
# This only computes the output corresponding to the target
y_hat_tg = h_softmax(x, batch_size, output_size, W1, b1, W2, b2,
h_softmax_level1_size, h_softmax_level2_size, y)
y_hat_tg = h_softmax(x, batch_size, output_size, h_softmax_level1_size,
h_softmax_level2_size, W1, b1, W2, b2, y)
# This computes all the outputs
y_hat_all = h_softmax(x, batch_size, output_size, W1, b1, W2, b2,
h_softmax_level1_size, h_softmax_level2_size)
y_hat_all = h_softmax(x, batch_size, output_size, h_softmax_level1_size,
h_softmax_level2_size, W1, b1, W2, b2)
#############
# Compile functions
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论