torchstain icon indicating copy to clipboard operation
torchstain copied to clipboard

Vahadane numpy backend

Open andreped opened this issue 1 year ago • 8 comments

I have reproduced the Vahadane implementation from StainTools. The implementation is with numpy backend, but there are two steps that remains for this to work with pure numpy.

Hence, this is a draft, where we can discuss where to go next.

The two challenges are:

  • Directionary learning step
  • LARS-LASSO step

Scikit-learn offer similar implementations as the one used by spams, but when swapping them, I was unable to get the same results. Hence, right now, the current implementation depends on spams.

This will also be a problem with both TensorFlow and PyTorch backends, as it might be challenging to implement these from scratch in an optimized manner with both backends.

Adding spams itself is not that challenging. However, pip-installing the original project has deemed challenging in several projects, which I have used spams. Luckily, there is someone who has built precompiled wheels which makes installation seemless: https://github.com/samuelstjean/spams-python/releases/tag/v2.6.4

I have not yet added spams as a dependency, and will wait for further instructions.

andreped avatar Dec 22 '22 21:12 andreped