提交 d069d32f 编写于 作者: C caoying03

rename mse into square_error after dev branch update.

上级 ed270282
...@@ -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__]
### 训练 ### 训练
......
...@@ -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
......
...@@ -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__]
### 训练 ### 训练
......
...@@ -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
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册