Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Add accuracy func and test mnist accuracy #40

Merged
merged 2 commits into from
Jun 28, 2018

Conversation

kexinzhao
Copy link
Collaborator

The accuracy is tested on the mnist test set.

Copy link
Collaborator

@tonyyang-svail tonyyang-svail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Linear linear3(200, 10, "relu");
std::string filename1 = "/tmp/mnist_train.recordio";
std::string filename2 = "/tmp/mnist_test.recordio";
PADDLE_ENFORCE(is_file_exist(filename1),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe put is_file_exist inside CreateRecordioFileReader

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -110,6 +110,9 @@ class Linear {
{{"X", {pre_bias}}, {"Y", {b_}}},
{{"Out", {pre_act}}},
add_op_attrs);
if (act_.empty()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also make Conv support act_.empty()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done for both conv and batchnorm

src/function.h Outdated
reader->GetMutable<paddle::framework::ReaderHolder>()->ReadNext(
&data_holder);
} else {
return {};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this return {} hide the check PADDLE_ENFORCE(!data_holder.empty(), "Error reading file.");?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Revised.

Copy link
Collaborator Author

@kexinzhao kexinzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments addressed.

src/function.h Outdated
reader->GetMutable<paddle::framework::ReaderHolder>()->ReadNext(
&data_holder);
} else {
return {};
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Revised.

@@ -110,6 +110,9 @@ class Linear {
{{"X", {pre_bias}}, {"Y", {b_}}},
{{"Out", {pre_act}}},
add_op_attrs);
if (act_.empty()) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done for both conv and batchnorm

Linear linear3(200, 10, "relu");
std::string filename1 = "/tmp/mnist_train.recordio";
std::string filename2 = "/tmp/mnist_test.recordio";
PADDLE_ENFORCE(is_file_exist(filename1),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Collaborator

@tonyyang-svail tonyyang-svail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

@kexinzhao kexinzhao merged commit 1c51c2f into PaddlePaddle:develop Jun 28, 2018
@kexinzhao kexinzhao deleted the add_accuracy_utility branch June 28, 2018 17:44
@tonyyang-svail tonyyang-svail mentioned this pull request Jun 28, 2018
36 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants