Skip to content

About back propagation of TV #3

@GlowingHorse

Description

@GlowingHorse

Thanks for your help, and I would like reading and try to reproduce the code.

The other question.
This is code from nnpreimage/layers/tv.m about the backpropagation of TV.

np = max(v, 1e-6).^(1 - 2/beta) ;
d1_ = np .* d1;
d2_ = np .* d2;
d11 = d1_(:,[1 1:end-1],:,:) - d1_ ;
d22 = d2_([1 1:end-1],:,:,:) - d2_ ;
d11(:,1,:,:) = - d1_(:,1,:,:) ;
d22(1,:,:,:) = - d2_(1,:,:,:) ;
dx = (beta/numPixels) * (d11 + d22) ;
If it's convenient, could you please tell me the paper or computing method of d11 = d1_(:,[1 1:end-1],:,:) - d1_ ; ? I just cannot get the right backpropagation function there. It seems like using Euler Lagrange equation to get this, not the common derivative.

Because, when I set

np = max(v, 1e-6).^(1 - 2/beta) ;
d1_ = np .* d1;
d2_ = np .* d2;
d11 = d1(:,[1 1:end-1],:,:) - d1;
d22 = d2([1 1:end-1],:,:,:) - d2_;
d11(:,1,:,:) = - d1(:,1,:,:) ;
d22(1,:,:,:) = - d2(1,:,:,:) ;
dx = (beta/numPixels) * (d11.*d1_ + d22.*d2_ ) ;
The value in dx cannot be kept in a reasonable range. Using your function in the code, the problem will not appear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions