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

I believe we are using WRONG mean-std prepossessing to CIFAR-100 #29

Open
dlmacedo opened this issue Jan 9, 2017 · 1 comment
Open

Comments

@dlmacedo
Copy link

dlmacedo commented Jan 9, 2017

Dear Friends,

I believe we are using the wrong mean std preprocessing to CIFAR-100 since the parameters in the code are for CIFAR-10 dataset.

David

@dlmacedo
Copy link
Author

dlmacedo commented Jan 9, 2017

--##
--[[
local meanstd = {mean = {125.3, 123.0, 113.9}, std  = {63.0,  62.1,  66.7}}
--]]
if opt.dataset == "./datasets/cifar10_original.t7" then
  meanstd = {mean = {125.3, 123.0, 113.9}, std  = {63.0,  62.1,  66.7}, dataset = "cifar-10"}
elseif opt.dataset == "./datasets/cifar100_original.t7" then
  meanstd = {mean = {129.3, 124.1, 112.4}, std  = {68.2,  65.4,  70.4}, dataset = "cifar-100"}
end
--##

print(c.blue '==>' ..' loading data')
local provider = torch.load(opt.dataset)
opt.num_classes = provider.testData.labels:max()
if torch.type(provider.trainData.data) == 'torch.ByteTensor' then
   --##
   print("##########")
   print(meanstd.dataset)
   print("##########")
   --##
   for i,v in ipairs{'trainData', 'testData'} do
      provider[v].data = provider[v].data:float()--:div(256)
      for ch=1,3 do
         provider[v].data:select(2,ch):add(-meanstd.mean[ch]):div(meanstd.std[ch])
      end
   end
end

@dlmacedo dlmacedo changed the title I believe We are using WRONG prepossessing to CIFAR-100 I believe we are using WRONG mean-std prepossessing to CIFAR-100 Jan 10, 2017
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

1 participant