未验证 提交 db948373 编写于 作者: S Sing_chan 提交者: GitHub

fix bug of bfgs example code;test=document_fix (#41195)

上级 9c2a9afd
......@@ -100,7 +100,7 @@ def minimize_bfgs(objective_func,
return paddle.dot(x, x)
x0 = paddle.to_tensor([1.3, 2.7])
results = paddle.optimizer.functional.minimize_bfgs(func, x0)
results = paddle.incubate.optimizer.functional.minimize_bfgs(func, x0)
print("is_converge: ", results[0])
print("the minimum of func is: ", results[2])
# is_converge: is_converge: Tensor(shape=[1], dtype=bool, place=Place(gpu:0), stop_gradient=True,
......
......@@ -89,7 +89,7 @@ def minimize_lbfgs(objective_func,
return paddle.dot(x, x)
x0 = paddle.to_tensor([1.3, 2.7])
results = paddle.optimizer.functional.minimize_lbfgs(func, x0)
results = paddle.incubate.optimizer.functional.minimize_lbfgs(func, x0)
print("is_converge: ", results[0])
print("the minimum of func is: ", results[2])
# is_converge: is_converge: Tensor(shape=[1], dtype=bool, place=Place(gpu:0), stop_gradient=True,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册