Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add common.h and remove DisableCopy and Typedefs #1004

Merged
merged 2 commits into from
Dec 27, 2016

Conversation

gangliao
Copy link
Contributor

No description provided.

图像分类教程
==========

在本教程中,我们将使用CIFAR-10数据集训练一个卷积神经网络,并使用这个神经网络来对图片进行分类。如下图所示,卷积神经网络可以辨识图片中的主体,并给出分类结果。
Copy link
Contributor Author

@gangliao gangliao Dec 23, 2016

Choose a reason for hiding this comment

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

忽略这两个文档文件。

@@ -147,7 +147,7 @@ for classification. A description of VGG network can be found here [http://www.r
# small_vgg is predined in trainer_config_helpers.network
predict = small_vgg(input_image=img, num_channels=3)
```
After writing the config, we can train the model by running the script train.sh. Notice that the following script assumes the you run the script in the `./demo/image_classification` folder. If you run the script in a different folder, you need to change the paths of the scripts and the configuration files accordingly.
After writing the config, we can train the model by running the script train.sh.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

忽略

@@ -58,6 +58,8 @@ class BatchNormalizationLayer : public BatchNormBaseLayer {
/// to batch, channels* imagePixels.
void shrinkMat(const MatrixPtr& in, MatrixPtr& out);

void onPassEnd() { firstTest_ = true; }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

忽略

Copy link
Collaborator

@reyoung reyoung left a comment

Choose a reason for hiding this comment

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

LGTM. Cool.

@reyoung reyoung merged commit 4ccd5ea into PaddlePaddle:develop Dec 27, 2016
/**
* Disable copy macro.
*/
#define DISABLE_COPY(class_name) \
Copy link
Collaborator

Choose a reason for hiding this comment

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

所以这个macro实际做的还是 DISABLE_COPY_AND_ASSIGN,只是希望有个短一点儿的名字?

Copy link
Contributor Author

@gangliao gangliao Dec 27, 2016

Choose a reason for hiding this comment

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

@wangkuiyi
paddle里面有冗余 有个地方叫做 DISABLE_COPY_AND_ASSIGN https://github.com/PaddlePaddle/Paddle/pull/1004/files/c8d0791accb7fbceda308756e6271e12e233c063#diff-115063b195553537162a362f6784ceb1L28

其他地方都用的是DISABLE_COPY这个头文件。
https://github.com/PaddlePaddle/Paddle/pull/1004/files/c8d0791accb7fbceda308756e6271e12e233c063#diff-af4f409b1f461e14cd371f23d15bb2feL20

DISABLE_COPY_AND_ASSIGN和DISABLE_COPY 都挺通用的。本质上都是copy。只是这里去掉DISABLE_COPY_AND_ASSIGN, 是因为改动影响更小

Copy link
Collaborator

@wangkuiyi wangkuiyi Dec 27, 2016

Choose a reason for hiding this comment

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

OK。明白了。

@gangliao gangliao deleted the common branch March 22, 2017 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants