Closed
Conversation
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

修改概述:
修改的详细描述
get_device(),自动在 CUDA / Apple MPS / CPU 之间切换,GPU 环境下训练提速约 10 倍以上。/255归一化;RandomAffine(±10° 旋转 + 10% 平移)数据增强,提升泛化能力。Dropout2d,并改用 Kaiming 初始化。Adam换成AdamW(解耦权重衰减);CosineAnnealingLR余弦退火调度;CrossEntropyLoss加入label_smoothing=0.1;num_workers=2与pin_memory,optimizer.zero_grad(set_to_none=True)节省显存。best_cnn_mnist.pth,并固定随机种子保证复现。经过了什么样的测试?
运行效
原来是99.2%, 现在是99.47%
动图、视频、截图等