layumi / 2016_super_resolution

ICCV2015 Image Super-Resolution Using Deep Convolutional Networks
MIT License
86 stars 43 forks source link

If I would like to set up the filter size, 9-5-5, should I change on "SRnet.m"? #9

Open star4s opened 7 years ago

star4s commented 7 years ago

conv2_1Block = dagnn.Conv('size',[9 9 3 64],'hasBias',true,'stride',[1,1],'pad',[0,0,0,0]); net.addLayer('conv2_1',conv2_1Block,{'input'},{'conv2_1'},{'c2_1f','c2_1b'}); net.addLayer('relu2_1',reluBlock,{'conv2_1'},{'conv2_1x'},{}); conv2_2Block = dagnn.Conv('size',[1 1 64 32],'hasBias',true,'stride',[1,1],'pad',[0,0,0,0]); net.addLayer('conv2_2',conv2_2Block,{'conv2_1x'},{'conv2_2'},{'c2_2f','c2_2b'}); net.addLayer('relu2_2',reluBlock,{'conv2_2'},{'conv2_2x'},{}); conv2_3Block = dagnn.Conv('size',[5 5 32 3],'hasBias',true,'stride',[1,1],'pad',[0,0,0,0]); net.addLayer('conv2_3',conv2_3Block,{'conv2_2x'},{'prediction'},{'c2_3f','c2_3b'});

================================================================== Top is your code in "SRnet.m". So if I change 9-5-5, I should change like the bottom part?

conv2_1Block = dagnn.Conv('size',[9 9 3 64],'hasBias',true,'stride',[1,1],'pad',[0,0,0,0]); net.addLayer('conv2_1',conv2_1Block,{'input'},{'conv2_1'},{'c2_1f','c2_1b'}); net.addLayer('relu2_1',reluBlock,{'conv2_1'},{'conv2_1x'},{}); conv2_2Block = dagnn.Conv('size',[5 5 64 32],'hasBias',true,'stride',[1,1],'pad',[0,0,0,0]); net.addLayer('conv2_2',conv2_2Block,{'conv2_1x'},{'conv2_2'},{'c2_2f','c2_2b'}); net.addLayer('relu2_2',reluBlock,{'conv2_2'},{'conv2_2x'},{}); conv2_3Block = dagnn.Conv('size',[5 5 32 3],'hasBias',true,'stride',[1,1],'pad',[0,0,0,0]); net.addLayer('conv2_3',conv2_3Block,{'conv2_2x'},{'prediction'},{'c2_3f','c2_3b'});

And

in the "train_SRnet.m"

label = img(7:end-6,7:end-6,:,:);

=>

label = img(7:end-10,7:end-10,:,:);

should I change?

layumi commented 7 years ago

Since we will cut the edge 8+4+4=16 pixels, I think 9:end-8 is beter. Noted that output size = (input size - filter size)/stride+1