diff --git a/fit_a_line/README.en.ipynb b/fit_a_line/README.en.ipynb index 110b3031026f1fd0d65cbb1b3a7d45c43c86ee7a..a819dc5d0db3f7aa639834722ad024c1f22f49dc 100644 --- a/fit_a_line/README.en.ipynb +++ b/fit_a_line/README.en.ipynb @@ -189,7 +189,7 @@ " size=1,\n", " act=paddle.activation.Linear())\n", "y = paddle.layer.data(name='y', type=paddle.data_type.dense_vector(1))\n", - "cost = paddle.layer.regression_cost(input=y_predict, label=y)\n" + "cost = paddle.layer.mse_cost(input=y_predict, label=y)\n" ], "outputs": [ { diff --git a/fit_a_line/README.en.md b/fit_a_line/README.en.md index eeef844d24c4ceb25028d7ec85a5335f82d5c51d..67bff40b73d02b02e54a6e7d555b4fbe4984d23b 100644 --- a/fit_a_line/README.en.md +++ b/fit_a_line/README.en.md @@ -132,7 +132,7 @@ y_predict = paddle.layer.fc(input=x, size=1, act=paddle.activation.Linear()) y = paddle.layer.data(name='y', type=paddle.data_type.dense_vector(1)) -cost = paddle.layer.regression_cost(input=y_predict, label=y) +cost = paddle.layer.mse_cost(input=y_predict, label=y) ``` ### Create Parameters diff --git a/fit_a_line/README.ipynb b/fit_a_line/README.ipynb index c690570a8a4ef048f2e3460a4b095919bf041f60..07f15fa38f330f55c63926888b2d732c486b2079 100644 --- a/fit_a_line/README.ipynb +++ b/fit_a_line/README.ipynb @@ -183,7 +183,7 @@ " size=1,\n", " act=paddle.activation.Linear())\n", "y = paddle.layer.data(name='y', type=paddle.data_type.dense_vector(1))\n", - "cost = paddle.layer.regression_cost(input=y_predict, label=y)\n" + "cost = paddle.layer.mse_cost(input=y_predict, label=y)\n" ], "outputs": [ { diff --git a/fit_a_line/README.md b/fit_a_line/README.md index 6ae43bcc591e51b9ff91c61f2c8ae7e6ff407c25..b4516851e7e106750740557ccfbf31c8f1e4f5d0 100644 --- a/fit_a_line/README.md +++ b/fit_a_line/README.md @@ -126,7 +126,7 @@ y_predict = paddle.layer.fc(input=x, size=1, act=paddle.activation.Linear()) y = paddle.layer.data(name='y', type=paddle.data_type.dense_vector(1)) -cost = paddle.layer.regression_cost(input=y_predict, label=y) +cost = paddle.layer.mse_cost(input=y_predict, label=y) ``` ### 创建参数 diff --git a/fit_a_line/index.en.html b/fit_a_line/index.en.html index 22d6aeaa7da7ef9277ca59ac29f8b0e62ba78fa3..0c8fe2e9afc637fe889270d960bd5a1e234df9cf 100644 --- a/fit_a_line/index.en.html +++ b/fit_a_line/index.en.html @@ -174,7 +174,7 @@ y_predict = paddle.layer.fc(input=x, size=1, act=paddle.activation.Linear()) y = paddle.layer.data(name='y', type=paddle.data_type.dense_vector(1)) -cost = paddle.layer.regression_cost(input=y_predict, label=y) +cost = paddle.layer.mse_cost(input=y_predict, label=y) ``` ### Create Parameters diff --git a/fit_a_line/index.html b/fit_a_line/index.html index 495d8e39726651c4efb2ce96d3c5da265bcfb171..efa0cc70e3671fa049e75798ef73268a5feaca28 100644 --- a/fit_a_line/index.html +++ b/fit_a_line/index.html @@ -168,7 +168,7 @@ y_predict = paddle.layer.fc(input=x, size=1, act=paddle.activation.Linear()) y = paddle.layer.data(name='y', type=paddle.data_type.dense_vector(1)) -cost = paddle.layer.regression_cost(input=y_predict, label=y) +cost = paddle.layer.mse_cost(input=y_predict, label=y) ``` ### 创建参数 diff --git a/fit_a_line/train.py b/fit_a_line/train.py index 6fae9e012e6153c6fc84a30ea72d82f2d9a80200..fc4d263eb73e5370fa5288abb2f1f11a1f0a22e0 100644 --- a/fit_a_line/train.py +++ b/fit_a_line/train.py @@ -10,7 +10,7 @@ def main(): x = paddle.layer.data(name='x', type=paddle.data_type.dense_vector(13)) y_predict = paddle.layer.fc(input=x, size=1, act=paddle.activation.Linear()) y = paddle.layer.data(name='y', type=paddle.data_type.dense_vector(1)) - cost = paddle.layer.regression_cost(input=y_predict, label=y) + cost = paddle.layer.mse_cost(input=y_predict, label=y) # create parameters parameters = paddle.parameters.create(cost) diff --git a/recommender_system/README.en.ipynb b/recommender_system/README.en.ipynb index 8c9addf7c8dcedc37f018f8621c98077e59fb3ff..2eb6ca909d12bc37e8f96cf5ff1ddaa8bf330697 100644 --- a/recommender_system/README.en.ipynb +++ b/recommender_system/README.en.ipynb @@ -449,7 +449,7 @@ }, "source": [ "inference = paddle.layer.cos_sim(a=usr_combined_features, b=mov_combined_features, size=1, scale=5)\n", - "cost = paddle.layer.regression_cost(\n", + "cost = paddle.layer.mse_cost(\n", " input=inference,\n", " label=paddle.layer.data(\n", " name='score', type=paddle.data_type.dense_vector(1)))\n" @@ -536,7 +536,7 @@ "\n", "```text\n", "[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]\n", - "[INFO 2017-03-06 17:12:13,379 networks.py:1478] The output order is [__regression_cost_0__]\n", + "[INFO 2017-03-06 17:12:13,379 networks.py:1478] The output order is [__mse_cost_0__]\n", "```\n", "\n", "### Training\n", diff --git a/recommender_system/README.en.md b/recommender_system/README.en.md index 9a1b5571cee03b926ac02dcc1d0f3920281db7f7..ca596efc749f24c9c3a8c9d1ee1f8dd1696d0a8f 100644 --- a/recommender_system/README.en.md +++ b/recommender_system/README.en.md @@ -254,7 +254,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.regression_cost( +cost = paddle.layer.mse_cost( input=inference, label=paddle.layer.data( name='score', type=paddle.data_type.dense_vector(1))) @@ -282,7 +282,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 [__regression_cost_0__] +[INFO 2017-03-06 17:12:13,379 networks.py:1478] The output order is [__mse_cost_0__] ``` ### Training diff --git a/recommender_system/README.ipynb b/recommender_system/README.ipynb index e6459c2ac70c4e011987d31f99fcf7f02a234bb1..df6835a5c837c6a2d44e6455bdd19b8b7e040ebc 100644 --- a/recommender_system/README.ipynb +++ b/recommender_system/README.ipynb @@ -479,7 +479,7 @@ "editable": true }, "source": [ - "cost = paddle.layer.regression_cost(\n", + "cost = paddle.layer.mse_cost(\n", " input=inference,\n", " label=paddle.layer.data(\n", " name='score', type=paddle.data_type.dense_vector(1)))\n" @@ -535,7 +535,7 @@ "source": [ "\n", " [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]\n", - " [INFO 2017-03-06 17:12:13,287 networks.py:1478] The output order is [__regression_cost_0__]\n", + " [INFO 2017-03-06 17:12:13,287 networks.py:1478] The output order is [__mse_cost_0__]\n", "\n", "\n", "`parameters`是模型的所有参数集合。他是一个python的dict。我们可以查看到这个网络中的所有参数名称。因为之前定义模型的时候,我们没有指定参数名称,这里参数名称是自动生成的。当然,我们也可以指定每一个参数名称,方便日后维护。\n", @@ -603,7 +603,7 @@ "source": [ "\n", " [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]\n", - " [INFO 2017-03-06 17:12:13,379 networks.py:1478] The output order is [__regression_cost_0__]\n", + " [INFO 2017-03-06 17:12:13,379 networks.py:1478] The output order is [__mse_cost_0__]\n", "\n", "\n", "### 训练\n", diff --git a/recommender_system/README.md b/recommender_system/README.md index 7ee55048784a8af070adb4efd94b0509a6d75638..94f072db7233681c53408e44a57dc93483c1cfe7 100644 --- a/recommender_system/README.md +++ b/recommender_system/README.md @@ -268,7 +268,7 @@ inference = paddle.layer.cos_sim(a=usr_combined_features, b=mov_combined_feature ```python -cost = paddle.layer.regression_cost( +cost = paddle.layer.mse_cost( input=inference, label=paddle.layer.data( name='score', type=paddle.data_type.dense_vector(1))) @@ -287,7 +287,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 [__regression_cost_0__] + [INFO 2017-03-06 17:12:13,287 networks.py:1478] The output order is [__mse_cost_0__] `parameters`是模型的所有参数集合。他是一个python的dict。我们可以查看到这个网络中的所有参数名称。因为之前定义模型的时候,我们没有指定参数名称,这里参数名称是自动生成的。当然,我们也可以指定每一个参数名称,方便日后维护。 @@ -311,7 +311,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 [__regression_cost_0__] + [INFO 2017-03-06 17:12:13,379 networks.py:1478] The output order is [__mse_cost_0__] ### 训练 diff --git a/recommender_system/index.en.html b/recommender_system/index.en.html index 819ae07cec931028ed264007d9af97b99f7b5335..d406e742da8c63eaf7162c5d0c6b0f234576f076 100644 --- a/recommender_system/index.en.html +++ b/recommender_system/index.en.html @@ -296,7 +296,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.regression_cost( +cost = paddle.layer.mse_cost( input=inference, label=paddle.layer.data( name='score', type=paddle.data_type.dense_vector(1))) @@ -324,7 +324,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 [__regression_cost_0__] +[INFO 2017-03-06 17:12:13,379 networks.py:1478] The output order is [__mse_cost_0__] ``` ### Training diff --git a/recommender_system/index.html b/recommender_system/index.html index 97df04a45fec4ada58c15074c30d08bd2b911bc0..491b1a6d52e4efa01838cb39531b6f01dd88349a 100644 --- a/recommender_system/index.html +++ b/recommender_system/index.html @@ -310,7 +310,7 @@ inference = paddle.layer.cos_sim(a=usr_combined_features, b=mov_combined_feature ```python -cost = paddle.layer.regression_cost( +cost = paddle.layer.mse_cost( input=inference, label=paddle.layer.data( name='score', type=paddle.data_type.dense_vector(1))) @@ -329,7 +329,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 [__regression_cost_0__] + [INFO 2017-03-06 17:12:13,287 networks.py:1478] The output order is [__mse_cost_0__] `parameters`是模型的所有参数集合。他是一个python的dict。我们可以查看到这个网络中的所有参数名称。因为之前定义模型的时候,我们没有指定参数名称,这里参数名称是自动生成的。当然,我们也可以指定每一个参数名称,方便日后维护。 @@ -353,7 +353,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 [__regression_cost_0__] + [INFO 2017-03-06 17:12:13,379 networks.py:1478] The output order is [__mse_cost_0__] ### 训练 diff --git a/recommender_system/train.py b/recommender_system/train.py index 62af9921feec5269e723ad6df8cbaaa9b0098bfe..e57599254cf2fb67309012db24febff28c66e6ed 100644 --- a/recommender_system/train.py +++ b/recommender_system/train.py @@ -61,7 +61,7 @@ def main(): inference = paddle.layer.cos_sim( a=usr_combined_features, b=mov_combined_features, size=1, scale=5) - cost = paddle.layer.regression_cost( + cost = paddle.layer.mse_cost( input=inference, label=paddle.layer.data( name='score', type=paddle.data_type.dense_vector(1)))