Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
book
提交
d069d32f
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看板
提交
d069d32f
编写于
9月 04, 2017
作者:
C
caoying03
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename mse into square_error after dev branch update.
上级
ed270282
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
11 addition
and
11 deletion
+11
-11
05.recommender_system/README.cn.md
05.recommender_system/README.cn.md
+3
-3
05.recommender_system/README.md
05.recommender_system/README.md
+2
-2
05.recommender_system/index.cn.html
05.recommender_system/index.cn.html
+3
-3
05.recommender_system/index.html
05.recommender_system/index.html
+2
-2
05.recommender_system/train.py
05.recommender_system/train.py
+1
-1
未找到文件。
05.recommender_system/README.cn.md
浏览文件 @
d069d32f
...
@@ -297,7 +297,7 @@ inference = paddle.layer.cos_sim(a=usr_combined_features, b=mov_combined_feature
...
@@ -297,7 +297,7 @@ inference = paddle.layer.cos_sim(a=usr_combined_features, b=mov_combined_feature
```
python
```
python
cost
=
paddle
.
layer
.
mse
_cost
(
cost
=
paddle
.
layer
.
square_error
_cost
(
input
=
inference
,
input
=
inference
,
label
=
paddle
.
layer
.
data
(
label
=
paddle
.
layer
.
data
(
name
=
'score'
,
type
=
paddle
.
data_type
.
dense_vector
(
1
)))
name
=
'score'
,
type
=
paddle
.
data_type
.
dense_vector
(
1
)))
...
@@ -316,7 +316,7 @@ parameters = paddle.parameters.create(cost)
...
@@ -316,7 +316,7 @@ parameters = paddle.parameters.create(cost)
```
```
[INFO 2017-03-06 17:12:13,284 networks.py:1472] The input order is [user_id, gender_id, age_id, job_id, movie_id, category_id, movie_title, score]
[INFO 2017-03-06 17:12:13,284 networks.py:1472] The input order is [user_id, gender_id, age_id, job_id, movie_id, category_id, movie_title, score]
[INFO 2017-03-06 17:12:13,287 networks.py:1478] The output order is [__
mse
_cost_0__]
[INFO 2017-03-06 17:12:13,287 networks.py:1478] The output order is [__
square_error
_cost_0__]
`parameters`
是模型的所有参数集合。他是一个python的dict。我们可以查看到这个网络中的所有参数名称。因为之前定义模型的时候,我们没有指定参数名称,这里参数名称是自动生成的。当然,我们也可以指定每一个参数名称,方便日后维护。
`parameters`
是模型的所有参数集合。他是一个python的dict。我们可以查看到这个网络中的所有参数名称。因为之前定义模型的时候,我们没有指定参数名称,这里参数名称是自动生成的。当然,我们也可以指定每一个参数名称,方便日后维护。
...
@@ -340,7 +340,7 @@ trainer = paddle.trainer.SGD(cost=cost, parameters=parameters,
...
@@ -340,7 +340,7 @@ trainer = paddle.trainer.SGD(cost=cost, parameters=parameters,
```
```
[INFO 2017-03-06 17:12:13,378 networks.py:1472] The input order is [user_id, gender_id, age_id, job_id, movie_id, category_id, movie_title, score]
[INFO 2017-03-06 17:12:13,378 networks.py:1472] The input order is [user_id, gender_id, age_id, job_id, movie_id, category_id, movie_title, score]
[INFO 2017-03-06 17:12:13,379 networks.py:1478] The output order is [__
mse
_cost_0__]
[INFO 2017-03-06 17:12:13,379 networks.py:1478] The output order is [__
square_error
_cost_0__]
### 训练
### 训练
...
...
05.recommender_system/README.md
浏览文件 @
d069d32f
...
@@ -275,7 +275,7 @@ Finally, we can use cosine similarity to calculate the similarity between user c
...
@@ -275,7 +275,7 @@ Finally, we can use cosine similarity to calculate the similarity between user c
```
python
```
python
inference
=
paddle
.
layer
.
cos_sim
(
a
=
usr_combined_features
,
b
=
mov_combined_features
,
size
=
1
,
scale
=
5
)
inference
=
paddle
.
layer
.
cos_sim
(
a
=
usr_combined_features
,
b
=
mov_combined_features
,
size
=
1
,
scale
=
5
)
cost
=
paddle
.
layer
.
mse
_cost
(
cost
=
paddle
.
layer
.
square_error
_cost
(
input
=
inference
,
input
=
inference
,
label
=
paddle
.
layer
.
data
(
label
=
paddle
.
layer
.
data
(
name
=
'score'
,
type
=
paddle
.
data_type
.
dense_vector
(
1
)))
name
=
'score'
,
type
=
paddle
.
data_type
.
dense_vector
(
1
)))
...
@@ -303,7 +303,7 @@ trainer = paddle.trainer.SGD(cost=cost, parameters=parameters,
...
@@ -303,7 +303,7 @@ trainer = paddle.trainer.SGD(cost=cost, parameters=parameters,
```
text
```
text
[INFO 2017-03-06 17:12:13,378 networks.py:1472] The input order is [user_id, gender_id, age_id, job_id, movie_id, category_id, movie_title, score]
[INFO 2017-03-06 17:12:13,378 networks.py:1472] The input order is [user_id, gender_id, age_id, job_id, movie_id, category_id, movie_title, score]
[INFO 2017-03-06 17:12:13,379 networks.py:1478] The output order is [__
mse
_cost_0__]
[INFO 2017-03-06 17:12:13,379 networks.py:1478] The output order is [__
square_error
_cost_0__]
```
```
### Training
### Training
...
...
05.recommender_system/index.cn.html
浏览文件 @
d069d32f
...
@@ -339,7 +339,7 @@ inference = paddle.layer.cos_sim(a=usr_combined_features, b=mov_combined_feature
...
@@ -339,7 +339,7 @@ inference = paddle.layer.cos_sim(a=usr_combined_features, b=mov_combined_feature
```python
```python
cost = paddle.layer.
mse
_cost(
cost = paddle.layer.
square_error
_cost(
input=inference,
input=inference,
label=paddle.layer.data(
label=paddle.layer.data(
name='score', type=paddle.data_type.dense_vector(1)))
name='score', type=paddle.data_type.dense_vector(1)))
...
@@ -358,7 +358,7 @@ parameters = paddle.parameters.create(cost)
...
@@ -358,7 +358,7 @@ parameters = paddle.parameters.create(cost)
```
```
[INFO 2017-03-06 17:12:13,284 networks.py:1472] The input order is [user_id, gender_id, age_id, job_id, movie_id, category_id, movie_title, score]
[INFO 2017-03-06 17:12:13,284 networks.py:1472] The input order is [user_id, gender_id, age_id, job_id, movie_id, category_id, movie_title, score]
[INFO 2017-03-06 17:12:13,287 networks.py:1478] The output order is [__
mse
_cost_0__]
[INFO 2017-03-06 17:12:13,287 networks.py:1478] The output order is [__
square_error
_cost_0__]
`parameters`是模型的所有参数集合。他是一个python的dict。我们可以查看到这个网络中的所有参数名称。因为之前定义模型的时候,我们没有指定参数名称,这里参数名称是自动生成的。当然,我们也可以指定每一个参数名称,方便日后维护。
`parameters`是模型的所有参数集合。他是一个python的dict。我们可以查看到这个网络中的所有参数名称。因为之前定义模型的时候,我们没有指定参数名称,这里参数名称是自动生成的。当然,我们也可以指定每一个参数名称,方便日后维护。
...
@@ -382,7 +382,7 @@ trainer = paddle.trainer.SGD(cost=cost, parameters=parameters,
...
@@ -382,7 +382,7 @@ trainer = paddle.trainer.SGD(cost=cost, parameters=parameters,
```
```
[INFO 2017-03-06 17:12:13,378 networks.py:1472] The input order is [user_id, gender_id, age_id, job_id, movie_id, category_id, movie_title, score]
[INFO 2017-03-06 17:12:13,378 networks.py:1472] The input order is [user_id, gender_id, age_id, job_id, movie_id, category_id, movie_title, score]
[INFO 2017-03-06 17:12:13,379 networks.py:1478] The output order is [__
mse
_cost_0__]
[INFO 2017-03-06 17:12:13,379 networks.py:1478] The output order is [__
square_error
_cost_0__]
### 训练
### 训练
...
...
05.recommender_system/index.html
浏览文件 @
d069d32f
...
@@ -317,7 +317,7 @@ Finally, we can use cosine similarity to calculate the similarity between user c
...
@@ -317,7 +317,7 @@ Finally, we can use cosine similarity to calculate the similarity between user c
```python
```python
inference = paddle.layer.cos_sim(a=usr_combined_features, b=mov_combined_features, size=1, scale=5)
inference = paddle.layer.cos_sim(a=usr_combined_features, b=mov_combined_features, size=1, scale=5)
cost = paddle.layer.
mse
_cost(
cost = paddle.layer.
square_error
_cost(
input=inference,
input=inference,
label=paddle.layer.data(
label=paddle.layer.data(
name='score', type=paddle.data_type.dense_vector(1)))
name='score', type=paddle.data_type.dense_vector(1)))
...
@@ -345,7 +345,7 @@ trainer = paddle.trainer.SGD(cost=cost, parameters=parameters,
...
@@ -345,7 +345,7 @@ trainer = paddle.trainer.SGD(cost=cost, parameters=parameters,
```text
```text
[INFO 2017-03-06 17:12:13,378 networks.py:1472] The input order is [user_id, gender_id, age_id, job_id, movie_id, category_id, movie_title, score]
[INFO 2017-03-06 17:12:13,378 networks.py:1472] The input order is [user_id, gender_id, age_id, job_id, movie_id, category_id, movie_title, score]
[INFO 2017-03-06 17:12:13,379 networks.py:1478] The output order is [__
mse
_cost_0__]
[INFO 2017-03-06 17:12:13,379 networks.py:1478] The output order is [__
square_error
_cost_0__]
```
```
### Training
### Training
...
...
05.recommender_system/train.py
浏览文件 @
d069d32f
...
@@ -72,7 +72,7 @@ def main():
...
@@ -72,7 +72,7 @@ def main():
mov_combined_features
=
get_mov_combined_features
()
mov_combined_features
=
get_mov_combined_features
()
inference
=
paddle
.
layer
.
cos_sim
(
inference
=
paddle
.
layer
.
cos_sim
(
a
=
usr_combined_features
,
b
=
mov_combined_features
,
size
=
1
,
scale
=
5
)
a
=
usr_combined_features
,
b
=
mov_combined_features
,
size
=
1
,
scale
=
5
)
cost
=
paddle
.
layer
.
mse
_cost
(
cost
=
paddle
.
layer
.
square_error
_cost
(
input
=
inference
,
input
=
inference
,
label
=
paddle
.
layer
.
data
(
label
=
paddle
.
layer
.
data
(
name
=
'score'
,
type
=
paddle
.
data_type
.
dense_vector
(
1
)))
name
=
'score'
,
type
=
paddle
.
data_type
.
dense_vector
(
1
)))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录