Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
book
提交
e4081a6b
B
book
项目概览
PaddlePaddle
/
book
通知
16
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
40
列表
看板
标记
里程碑
合并请求
37
Wiki
5
Wiki
分析
仓库
DevOps
项目成员
Pages
B
book
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
40
Issue
40
列表
看板
标记
里程碑
合并请求
37
合并请求
37
Pages
分析
分析
仓库分析
DevOps
Wiki
5
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e4081a6b
编写于
3月 08, 2017
作者:
H
Helin Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add l2 regularization to reduce fpe English README part
上级
9c9c7437
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
4 deletion
+10
-4
machine_translation/README.en.md
machine_translation/README.en.md
+5
-2
machine_translation/index.en.html
machine_translation/index.en.html
+5
-2
未找到文件。
machine_translation/README.en.md
浏览文件 @
e4081a6b
...
...
@@ -208,6 +208,7 @@ This subset has 193319 instances of training data and 6003 instances of test dat
### Initialize PaddlePaddle
```
python
import
sys
import
paddle.v2
as
paddle
# train with a single CPU
...
...
@@ -396,7 +397,9 @@ for param in parameters.keys():
We need to tell trainer what to optimize, and how to optimize. Here trainer will optimize `cost` layer using stochastic gradient descent (SDG).
```python
optimizer = paddle.optimizer.Adam(learning_rate=1e-4)
optimizer = paddle.optimizer.Adam(
learning_rate=5e-5,
regularization=paddle.optimizer.L2Regularization(rate=1e-3))
trainer = paddle.trainer.SGD(cost=cost,
parameters=parameters,
update_equation=optimizer)
...
...
@@ -410,7 +413,7 @@ for param in parameters.keys():
def event_handler(event):
if isinstance(event, paddle.event.EndIteration):
if event.batch_id % 10 == 0:
print "Pass %d, Batch %d, Cost %f, %s" % (
print "
\n
Pass %d, Batch %d, Cost %f, %s" % (
event.pass_id, event.batch_id, event.cost, event.metrics)
```
...
...
machine_translation/index.en.html
浏览文件 @
e4081a6b
...
...
@@ -250,6 +250,7 @@ This subset has 193319 instances of training data and 6003 instances of test dat
### Initialize PaddlePaddle
```python
import sys
import paddle.v2 as paddle
# train with a single CPU
...
...
@@ -438,7 +439,9 @@ for param in parameters.keys():
We need to tell trainer what to optimize, and how to optimize. Here trainer will optimize `cost` layer using stochastic gradient descent (SDG).
```python
optimizer = paddle.optimizer.Adam(learning_rate=1e-4)
optimizer = paddle.optimizer.Adam(
learning_rate=5e-5,
regularization=paddle.optimizer.L2Regularization(rate=1e-3))
trainer = paddle.trainer.SGD(cost=cost,
parameters=parameters,
update_equation=optimizer)
...
...
@@ -452,7 +455,7 @@ for param in parameters.keys():
def event_handler(event):
if isinstance(event, paddle.event.EndIteration):
if event.batch_id % 10 == 0:
print "Pass %d, Batch %d, Cost %f, %s" % (
print "
\n
Pass %d, Batch %d, Cost %f, %s" % (
event.pass_id, event.batch_id, event.cost, event.metrics)
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录