Skip to content

Conversation

@thom-dani
Copy link
Contributor

@thom-dani thom-dani commented Apr 15, 2025

Thanks for contributing to TTK!

Before submitting your pull request, please:

  • Review our Contributor Guidelines, in particular regarding code formatting (with clang-format) and continuous integration.

  • Please provide a quick description of your contributions below:

Implementation of stochastic discrete gradient.

@julien-tierny
Copy link
Collaborator

TODO:

  • add a second template parameter to the discrete gradient toolbox, with a default value (that will prevent a break in compatibility with pre-existing calling code)

@julien-tierny
Copy link
Collaborator

  • perf check wrt tdev: OK!
  • default backend selection: OK!

@julien-tierny
Copy link
Collaborator

julien-tierny commented Nov 24, 2025

@thom-dani bug report

  • in the paraview gui, open a dataset,
  • ask to compute the morse-smale complex with the stochastic gradient
  • change the seed for the stochastic gradient
  • nothing happens (i.e., the separatrices don't change wrt the first computation)

the problem is that there is a gradient caching mechanism and that mechanism needs to be disabled if the gradient parameters (backend, seed) change from one execution to the next.

thanks for fixing this ASAP and letting me know when this is done.

@julien-tierny
Copy link
Collaborator

hi @thom-dani , thanks for the hot fix.
there's still an issue with the way gradient cache is handled.
consider the following use case:

  • compute the morse smale complex with the homotopic expansion, click on apply
  • modify the backend to the stochastic gradient, click on apply
  • now click on the button "Execute" (the backend hasn't change, nor the seed, so we use the cached gradient) ==> the code uses the gradient from the homotopic expansion.
    are you sure you store the stochastic gradient to cache?

@thom-dani
Copy link
Contributor Author

thom-dani commented Dec 1, 2025

Hello @julien-tierny, I fixed the bug and I don't observe the behavior you described anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants