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

data_augmentation function #10

Open
yiyunchen opened this issue Mar 12, 2019 · 5 comments
Open

data_augmentation function #10

yiyunchen opened this issue Mar 12, 2019 · 5 comments

Comments

@yiyunchen
Copy link

When I was runing the generatepatches.m, a error was raised that "undefined function or variable 'data_augmentation'.
I would like asking about it, is it a default function or user defined function that no provided?
thank you very much!

@cszn
Copy link
Owner

cszn commented Mar 12, 2019

@yiyunchen
Copy link
Author

thank you!
and I am confused about the code:

for x = 1 : stride : (hei-size_input+1)
for y = 1 : stride : (wid-size_input+1)
x_l = stride_low*(x-1)/stride + 1;
y_l = stride_low*(y-1)/stride + 1;
if x_l+size_input/scale-1 > size(LR,1) || y_l+size_input/scale-1 > size(LR,2)
continue;
end
count=count+1;
end
end

in generatedpatches.
May I ask what this is trying to do.
Thank you.

@cszn
Copy link
Owner

cszn commented Mar 13, 2019

In matlab, pre-define the large matrix is useful to the memery.

For example,

n = 1000000;
A = zeros(1, n); 
for i = 1:n
  A(i) = i; 
end

is better than

n = 1000000;
for i = 1:n
  A(i) = i; 
end

@yiyunchen
Copy link
Author

Is it used to compute the 'count'?

@cszn
Copy link
Owner

cszn commented Mar 13, 2019

Yes. @yiyunchen

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

2 participants