DSN
DSN copied to clipboard
Question about the accuracy of the result
Hi,really thank you for your code,the code is just what I want.I want to ask you about the accuracy of the result.I do not know why I just get about 73%,I didn't change any parameters in the code,everything is just default. So can you tell me what is the problem about this? Many thanks~
The accuracy I get is about 76%. I am trying to get higher accyracy.
python 3.6.12
pytorch 1.4.0
torchvision 0.5.0
To run the code with python3 and pytorch 1.x, I modified some codes. I find something interesting:
- The transformation of the image dataset matters:
# mnist transformation 1
# I got very low accuracy with the hyper-parameter not modified.
# img_transform_source = transforms.Compose([
# transforms.Resize(image_size),
# transforms.ToTensor(),
# transforms.Normalize(mean=(0.1307,), std=(0.3081,))
# ])
# mnist transformation 2
# accuracy about 76%
img_transform_source = transforms.Compose([
transforms.Resize(image_size),
transforms.ToTensor(),
transforms.Normalize(mean=(0.5,), std=(0.5,))
])
# mnist-m transformation
img_transform_target = transforms.Compose([
transforms.Resize(image_size),
transforms.ToTensor(),
transforms.Normalize(mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5))
])
- the implementation of SI-MSE:
The author utilizes
loss_recon1 + loss_recon2
in thetrain.py
. Actually,loss_recon1 - loss_recon2
is right. The author finds+
is better than-
. I find the same result.
If anyone who gets higher accuracy than 76%, can you tell me your implemantation details? Many thanks!
/
我得到的准确率约为 76%。我正在努力获得更高的准确性。
python 3.6.12 pytorch 1.4.0 torchvision 0.5.0
为了使用 python3 和 pytorch 1.x 运行代码,我修改了一些代码。我发现一些有趣的事情:
- 图像数据集的转换很重要:
# mnist transformation 1 # I got very low accuracy with the hyper-parameter not modified. # img_transform_source = transforms.Compose([ # transforms.Resize(image_size), # transforms.ToTensor(), # transforms.Normalize(mean=(0.1307,), std=(0.3081,)) # ]) # mnist transformation 2 # accuracy about 76% img_transform_source = transforms.Compose([ transforms.Resize(image_size), transforms.ToTensor(), transforms.Normalize(mean=(0.5,), std=(0.5,)) ]) # mnist-m transformation img_transform_target = transforms.Compose([ transforms.Resize(image_size), transforms.ToTensor(), transforms.Normalize(mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5)) ])
- SI-MSE的实现: 作者
loss_recon1 + loss_recon2
在train.py
. 其实,loss_recon1 - loss_recon2
是对的。作者发现+
比-
. 我发现同样的结果。如果有人获得高于 76% 的准确率,你能告诉我你的实现细节吗?非常感谢!
您好,可以请教一下在python3中应该怎样修改代码吗?我在数据导入的时候出现了这个问题,FileNotFoundError: [Errno 2] No such file or directory: './dataset/mnist_m/mnist_m_train_labels.txt',已经修改了print的写法