提交 38515d4f authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Minor rephrasing of some comment in a code example, to be clearer

上级 ed9143d0
...@@ -398,7 +398,9 @@ Here is an example showing how to use verify_grad: ...@@ -398,7 +398,9 @@ Here is an example showing how to use verify_grad:
>>> # cause verify_grad to crash. >>> # cause verify_grad to crash.
>>> op = tensor.nnet.crossentropy_softmax_argmax_1hot_with_bias >>> op = tensor.nnet.crossentropy_softmax_argmax_1hot_with_bias
>>> def op_with_fixed_y_idx(x, b): >>> def op_with_fixed_y_idx(x, b):
>>> # Note that this op has multiple outputs: we need to pick only one. >>> # Although this op has multiple outputs, we can return only one.
>>> # Here, we return the first output only, and fix the value of the
>>> # `y_idx` input to some constant array.
>>> return op(x, b, y_idx=numpy.asarray([0, 2]))[0] >>> return op(x, b, y_idx=numpy.asarray([0, 2]))[0]
>>> x_val = numpy.asarray([[-1, 0, 1], [3, 2, 1]], dtype='float64') >>> x_val = numpy.asarray([[-1, 0, 1], [3, 2, 1]], dtype='float64')
>>> b_val = numpy.asarray([1, 2, 3], dtype='float64') >>> b_val = numpy.asarray([1, 2, 3], dtype='float64')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论