提交 369ac0c4 编写于 作者: T Tink_Y 提交者: Cheerego

add missed lines for programming guide (#517)

* fixed missed lines for programming guide

* Update programming_guide.md
上级 8ff7fa1c
...@@ -384,6 +384,9 @@ outs = exe.run( ...@@ -384,6 +384,9 @@ outs = exe.run(
#定义损失函数 #定义损失函数
cost = fluid.layers.square_error_cost(input=y_predict,label=y) cost = fluid.layers.square_error_cost(input=y_predict,label=y)
avg_cost = fluid.layers.mean(cost) avg_cost = fluid.layers.mean(cost)
#定义优化方法
sgd_optimizer = fluid.optimizer.SGD(learning_rate=0.01)
sgd_optimizer.minimize(avg_cost)
#参数初始化 #参数初始化
cpu = fluid.core.CPUPlace() cpu = fluid.core.CPUPlace()
exe = fluid.Executor(cpu) exe = fluid.Executor(cpu)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册