brain-slam / slam

Surface anaLysis And Modeling
MIT License
14 stars 24 forks source link

Rewrite functions that use loops instead of numpy array #53

Open JulienLefevreMars opened 3 years ago

JulienLefevreMars commented 3 years ago

From what I can see, there are several candidate functions in at least the following modules:

alexpron commented 3 years ago

Ty @JulienLefevreMars for pointing that out ! From what i see in the github tree you started the optimization process, thank you very much for that :). What would be the function to optimize first according to your needs?

JulienLefevreMars commented 3 years ago

Yep, it's solved for gradient (the gain is huge, as expected). In curvature.py there are two functions:

Quite similar pattern in the two cases with a for loop on the vertices and in each step a linear algebra operation. In curvature_fit it is a bit more complicated because the size of the matrix depends on the size of the neighborhood. It should be possible to use a compact expression with sparse matrices describing the vertex/vertices or vertex/faces relationships. We need to formalize that as soon as we have 1H and a blackboard :-)