DSN icon indicating copy to clipboard operation
DSN copied to clipboard

Question about the accuracy of the result

Open 475000327 opened this issue 5 years ago • 2 comments

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~

475000327 avatar Sep 18 '19 09:09 475000327

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:

  1. 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))
])
  1. the implementation of SI-MSE: The author utilizes loss_recon1 + loss_recon2 in the train.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!

codenie avatar Dec 22 '20 03:12 codenie

/

我得到的准确率约为 76%。我正在努力获得更高的准确性。

python 3.6.12
pytorch 1.4.0
torchvision 0.5.0

为了使用 python3 和 pytorch 1.x 运行代码,我修改了一些代码。我发现一些有趣的事情:

  1. 图像数据集的转换很重要:
# 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))
])
  1. SI-MSE的实现: 作者loss_recon1 + loss_recon2train.py. 其实,loss_recon1 - loss_recon2是对的。作者发现+-. 我发现同样的结果。

如果有人获得高于 76% 的准确率,你能告诉我你的实现细节吗?非常感谢!

您好,可以请教一下在python3中应该怎样修改代码吗?我在数据导入的时候出现了这个问题,FileNotFoundError: [Errno 2] No such file or directory: './dataset/mnist_m/mnist_m_train_labels.txt',已经修改了print的写法

Sheep-L avatar Nov 12 '23 08:11 Sheep-L