From d069d32fb692921cb9036625f0672dbe5b2f610d Mon Sep 17 00:00:00 2001 From: caoying03 Date: Mon, 4 Sep 2017 14:29:29 +0800 Subject: [PATCH] rename mse into square_error after dev branch update. --- 05.recommender_system/README.cn.md | 6 +++--- 05.recommender_system/README.md | 4 ++-- 05.recommender_system/index.cn.html | 6 +++--- 05.recommender_system/index.html | 4 ++-- 05.recommender_system/train.py | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/05.recommender_system/README.cn.md b/05.recommender_system/README.cn.md index 03dff96..365c8a7 100644 --- a/05.recommender_system/README.cn.md +++ b/05.recommender_system/README.cn.md @@ -297,7 +297,7 @@ inference = paddle.layer.cos_sim(a=usr_combined_features, b=mov_combined_feature ```python -cost = paddle.layer.mse_cost( +cost = paddle.layer.square_error_cost( input=inference, label=paddle.layer.data( name='score', type=paddle.data_type.dense_vector(1))) @@ -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,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。我们可以查看到这个网络中的所有参数名称。因为之前定义模型的时候,我们没有指定参数名称,这里参数名称是自动生成的。当然,我们也可以指定每一个参数名称,方便日后维护。 @@ -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,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__] ### 训练 diff --git a/05.recommender_system/README.md b/05.recommender_system/README.md index 1d8e204..6ba636f 100644 --- a/05.recommender_system/README.md +++ b/05.recommender_system/README.md @@ -275,7 +275,7 @@ Finally, we can use cosine similarity to calculate the similarity between user c ```python 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, label=paddle.layer.data( name='score', type=paddle.data_type.dense_vector(1))) @@ -303,7 +303,7 @@ trainer = paddle.trainer.SGD(cost=cost, parameters=parameters, ```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,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 diff --git a/05.recommender_system/index.cn.html b/05.recommender_system/index.cn.html index d4b64af..97f13fd 100644 --- a/05.recommender_system/index.cn.html +++ b/05.recommender_system/index.cn.html @@ -339,7 +339,7 @@ inference = paddle.layer.cos_sim(a=usr_combined_features, b=mov_combined_feature ```python -cost = paddle.layer.mse_cost( +cost = paddle.layer.square_error_cost( input=inference, label=paddle.layer.data( name='score', type=paddle.data_type.dense_vector(1))) @@ -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,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。我们可以查看到这个网络中的所有参数名称。因为之前定义模型的时候,我们没有指定参数名称,这里参数名称是自动生成的。当然,我们也可以指定每一个参数名称,方便日后维护。 @@ -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,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__] ### 训练 diff --git a/05.recommender_system/index.html b/05.recommender_system/index.html index a38ada7..8273b2c 100644 --- a/05.recommender_system/index.html +++ b/05.recommender_system/index.html @@ -317,7 +317,7 @@ Finally, we can use cosine similarity to calculate the similarity between user c ```python 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, label=paddle.layer.data( name='score', type=paddle.data_type.dense_vector(1))) @@ -345,7 +345,7 @@ trainer = paddle.trainer.SGD(cost=cost, parameters=parameters, ```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,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 diff --git a/05.recommender_system/train.py b/05.recommender_system/train.py index 37d35ed..cb549e4 100644 --- a/05.recommender_system/train.py +++ b/05.recommender_system/train.py @@ -72,7 +72,7 @@ def main(): mov_combined_features = get_mov_combined_features() 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, label=paddle.layer.data( name='score', type=paddle.data_type.dense_vector(1))) -- GitLab