Giter VIP home page Giter VIP logo

Comments (7)

binhhuyle avatar binhhuyle commented on August 11, 2024 3

Hi @pramanc,

A good reference that I would recommend is the book "Numerical Methods for Least Squares Problems" by Ake Bjorck.
You can check two chapters:

  • Constrained Least Squares Problems --> Linear Equality Constraints
  • Constrained Least Squares Problems --> Linear Inequality Constraints

I wrote a little bit (not very completed) about my implementation here: https://uh-ir.tdl.org/handle/10657/1824
(in chapter 3.7 Skinning Weights Update)

from dem-bones.

binhhuyle avatar binhhuyle commented on August 11, 2024

Re: A is zero matrix problem

A in solveP function should not be zero. It is positive definite due to the construction, it is actually A^T*A (A transposed * A).

from dem-bones.

pramanc avatar pramanc commented on August 11, 2024

@binhhuyle Thank you for your reply!

zero matrix problem actually happens in

solveP function:
z=q2[np-2]*( //Re-project
(q2[np-2].transpose()*indexing_row_col(aTa, idx.head(np), idx.head(np))q2[np-2]).colPivHouseholderQr().solve( //A
q2[np-2].transpose()
(indexing_vector(aTb, idx.head(np))-indexing_row(aTa, idx.head(np))*x) )); //b

the matrix (q2[np-2].transpose()*indexing_row_col(aTa, idx.head(np), idx.head(np))*q2[np-2]) sometimes will be zero matrix

=======================================================
I will read the reference to see why it happens

Thank you again! Really amazing work!

from dem-bones.

robertjoosten avatar robertjoosten commented on August 11, 2024

Hello, hope both of you are doing well.
I think I'm running into the same problem and wanted to double check to see if either of you have found a solution or the cause of the problem.

After solving p it contains nan values and zeros. Which results in iMin being -1.
_Scalar eps=std::abs(x(idx[iMin]));

Just debugged the values after the solve and I am doing something terribly wrong.
aTa:
-nan(ind) -nan(ind) -nan(ind) -nan(ind) -nan(ind)
-nan(ind) -nan(ind) -nan(ind) -nan(ind) -nan(ind)
-nan(ind) -nan(ind) -nan(ind) -nan(ind) -nan(ind)
-nan(ind) -nan(ind) -nan(ind) -nan(ind) -nan(ind)
-nan(ind) -nan(ind) -nan(ind) -nan(ind) -nan(ind)
aTb:
-nan(ind)
-nan(ind)
-nan(ind)
-nan(ind)
-nan(ind)
aTa:
-nan(ind) -nan(ind) -nan(ind) -nan(ind) -nan(ind)
-nan(ind) -nan(ind) -nan(ind) -nan(ind) -nan(ind)
-nan(ind) -nan(ind) -nan(ind) -nan(ind) -nan(ind)
-nan(ind) -nan(ind) -nan(ind) -nan(ind) -nan(ind)
-nan(ind) -nan(ind) -nan(ind) -nan(ind) -nan(ind)
aTb:
-nan(ind)
-nan(ind)
-nan(ind)
-nan(ind)
-nan(ind)
x:
0.876707
0
0
0.123293
0
np:
2
affine:
1
p:
-nan(ind)
0
0
-nan(ind)
0

from dem-bones.

pramanc avatar pramanc commented on August 11, 2024

@robertjoosten Hi, Can you supply the data(aTa, aTb, x, idx, np, affine, p) passed in solveP?

from dem-bones.

robertjoosten avatar robertjoosten commented on August 11, 2024

Hello @pramanc

I've narrowed it down a bit further. I think it goes wrong because of nan values introduced in m during the computeTransformations step.

m looks fine when it comes in ( identity matrix )
When computing vuT nan values make their way into the vuT which propagate to m ( I am assuming, in over my head with this level of math )

Here are some debug values for values in the SparseMatrix::InnerIterator in compute_vuT
The height it value coming from the weights makes me thing that might be where the problem lies.

it row
5
it value
6.15434e+255
v
0.987688
-0.156434
0
u
0.987688 -0.156434 0 1
temp
0.975528 -0.154508 0 0.987688
-0.154508 0.0244717 -0 -0.156434
0 -0 0 0
0.987688 -0.156434 0 1
vuT
6.00373e+255 -9.50897e+254 0 6.07857e+255
-9.50897e+254 1.50607e+254 -0 -9.6275e+254
0 -0 0 0
6.07857e+255 -9.6275e+254 0 6.15434e+255
vutP
inf -inf -nan(ind) inf
-inf inf -nan(ind) -inf
-nan(ind) -nan(ind) -nan(ind) -nan(ind)
inf -inf -nan(ind) inf

I really doubt this is related to the original issue anymore, happy to take the discussion away from this thread
Edit: this was me populating the weights incorrectly causing the matrices to flip out... sorry for the inconvenience

from dem-bones.

pramanc avatar pramanc commented on August 11, 2024

6.15434e+255

well, definitely your sparse matrix w is wrong to make it value(6.15434e+255),you can check the fbxreader part to see if you get right weight matrix w

from dem-bones.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.