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

How did you derive the gradient of GenerateProFlow? #6

Open
richardwth opened this issue Sep 15, 2020 · 1 comment
Open

How did you derive the gradient of GenerateProFlow? #6

richardwth opened this issue Sep 15, 2020 · 1 comment

Comments

@richardwth
Copy link

Hi, thanks for the wonderful paper and code.

I am trying to extend your method in my application where the project distortion is more flexible, that is, x3 = 1 - x4 and x1 < x4 in the function distortion_model.distortionParameter() do not always hold. I have tried my best to understand the mathematics of project distortion in your code. Currently, this function modelNetS.GenerateProFlow.backward() confuses me the most. The gradient is calculated as follows:

for s in range(batchSize):
    x = Input[s]*ProFactor
            
    t00 = -1.0*((2*H-2)*i+(1-H)*W+H-1)*j
    t01 = (4*j*j+(8-8*H)*j+4*H*H-8*H+4)*x*x+((4*H-4)*j-4*H*H+8*H-4)*x+H*H-2*H+1
    grad_current[s,0] = ProFactor*t00/t01
            
    t10 = -1.0*((99*H-99)*j*j+(-99*H*H+198*H-99)*j)
    t11 = (200*j*j+(400-400*H)*j+200*H*H-400*H+200)*x*x+((200*H-200)*j-200*H*H+400*H-200)*x+50*H*H-100*H+50
    grad_current[s,1] = ProFactor*t10/t11
        
    grad = grad_output * grad_current

for s in range(batchSize):
    grad_input[s,0] = torch.sum(grad[s,:,:,:])

May I request your advice about how this is derived or where I can find the related paper or tutorial? Any help on how a11 - a32 are derived in the function distortion_model.distortionParameter() is also much appreciated.

@jingaoyin
Copy link

Hey bro,
Do you have the code of GenerateProFlow .The code to generate the prediction flow is now missing from the author's zip package .Could you send it to me if you have it,I really need it.
My E-mail is [email protected]
Thanks so much!

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