-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Conversation
图像分类教程 | ||
========== | ||
|
||
在本教程中,我们将使用CIFAR-10数据集训练一个卷积神经网络,并使用这个神经网络来对图片进行分类。如下图所示,卷积神经网络可以辨识图片中的主体,并给出分类结果。 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
忽略
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Cool.
/** | ||
* Disable copy macro. | ||
*/ | ||
#define DISABLE_COPY(class_name) \ |
There was a problem hiding this comment.
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,只是希望有个短一点儿的名字?
There was a problem hiding this comment.
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, 是因为改动影响更小
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK。明白了。
No description provided.