omrysendik / DCor

Deep Correlations for Texture Synthesis
BSD 3-Clause "New" or "Revised" License
18 stars 10 forks source link

What's the meaning of sigma? #3

Closed wzm2256 closed 6 years ago

wzm2256 commented 6 years ago

I'd like to ask the meaning of sigma. There are two parameters in smoothing loss, one is gamma, which is the penalty 'strength', but what is the meaning of sigma?

Can you explain a little?

omrysendik commented 6 years ago

Sigma controls the sensitivity to pixel similarity. Take a look at the following example: Let's assume we define a neighborhood of only 2 pixels, and in which the minimal distance between a pair of pixels is 1. Let's also assume the distance between the second pair is very large so we can neglect it (but I won't neglect it enough to cancel out the exp and log :-) ). Now, we are left with a term of exp(-Sig*1). This implies that increasing Sig will decrease the penalty meaning that you are less sensitive to pixels at a given distance. You can think of it as a hyper parameter controlling the degree of smoothness which you require.

@wzm2256 please let me know if this is clear and if not, I'll do my best to give it another shot.

wzm2256 commented 6 years ago

I'm afraid no. In your example, we have a pixel with 2 neighbors, one of the neighbors is different by 1, the other is so different that can be neglect. As a result, we are left with a term (1/Sig)log(exp(-Sig1)) which is -1, (you seem to leave out the log term?). So Sig is not used at all?

Actually, I'm trying to tuning these parameters, because some of the results are still noisy, but it is difficult unless I know the roles these parameters play.

Intuitively, both sigma and gamma controls the degree of smoothness, any difference between them?

wzm2256 commented 6 years ago

I guess, when sigma is closer to 0, this loss is more like TV loss, and conversely, when sigma is bigger, this loss is more 'selective', allowing more difference in some direction. and gamma is like the penalty weight, when the weight is high, more pressure is exert.

omrysendik commented 6 years ago

Here's a plot for a support of 3 pixels, with the distance between the center and the first neighbour being 1 and the distance to the second neighbour being 10. I plot the smoothness loss as a function of Sigma (rather than as a function of the distances). What you will see is that as we increase Sigma, we penalize less since we increase the bandwidth: dcor_issue

wzm2256 commented 6 years ago

OK, I understand. Thanks for your explanation.