NumesSanguis / FACSvatar

An Open Source Modular Framework From Face to FACS Based Avatar Animation (Unity3D / Blender)
GNU Lesser General Public License v3.0
430 stars 97 forks source link

Some confusion about n_array #11

Closed xjqxzh1 closed 5 years ago

xjqxzh1 commented 5 years ago

Hi NumesSanguis I‘m learning the bridge module about how to smooth data.I notice that in softmax_smooth2 function the first number of n_array is set to 1.But in facsvatar paper, the smoothing formula shows n start at 0.I wonder about the difference between the two ways.Hope you could give me some suggestions. Thanks again.

NumesSanguis commented 5 years ago

Thank you for pointing this out. I didn't notice this discrepancy between paper and code. In practice the result of the code and paper is the same. This would be the formula currently used in the code: FACSvatar_smooth_CodeCogsEqn

Let's take an example where we have an array of len(Xn) = 2, with X0 = .4 and X1 = .25. We also set \alpha = 0.3. On a calculator, this gives the exact same outcome: Paper: (e^(-.3*0)*.4 + e^(-.3*1)*.25) / ((e^(-.3*0) + e^(-.3*1)) = 0.336166 Code: (e^(-.3*1)*.4 + e^(-.3*2)*.25) / ((e^(-.3*1) + e^(-.3*2)) = 0.336166

I hope this clears the confusion?

xjqxzh1 commented 5 years ago

Thank you for pointing this out. I didn't notice this discrepancy between paper and code. In practice the result of the code and paper is the same. This would be the formula currently used in the code: FACSvatar_smooth_CodeCogsEqn

Let's take an example where we have an array of len(Xn) = 2, with X0 = .4 and X1 = .25. We also set \alpha = 0.3. On a calculator, this gives the exact same outcome: Paper: (e^(-.3*0)*.4 + e^(-.3*1)*.25) / ((e^(-.3*0) + e^(-.3*1)) = 0.336166 Code: (e^(-.3*1)*.4 + e^(-.3*2)*.25) / ((e^(-.3*1) + e^(-.3*2)) = 0.336166

I hope this clears the confusion?

Now I have a more intuitive understanding of this formula.Thanks a lot!!!