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

Question about the accuracy of the result #7

Open
475000327 opened this issue Sep 18, 2019 · 2 comments
Open

Question about the accuracy of the result #7

475000327 opened this issue Sep 18, 2019 · 2 comments

Comments

@475000327
Copy link

475000327 commented Sep 18, 2019

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~

@codenie
Copy link

codenie commented Dec 22, 2020

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!

@Sheep-L
Copy link

Sheep-L commented Nov 12, 2023

/

我得到的准确率约为 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的写法

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

No branches or pull requests

3 participants