Comments (4)
@MandMarc thanks for the input! This could be interesting, perhaps it is only a matter of adding appropriate bindings to the C++ code. Both @MonkeyBreaker and I are very busy these days so we ca''t give you a timeframe if we have to do it ourselves but of course we accept PRs and we could try to help you if you'd like to try to add this feature yourself.
from pyflagser.
Yes, I thought so too since the functionality technically already exists! Actually, I'm pretty interested in working on bindings etc. However, I have never done this before and don't have too much experience in C++ (a little tho), so this would require quite some time on my side which I won't have before christmas holidays unfortunately. Nonetheless, could you by any chance recommend some material/references regarding the whole Python C++ binding topic?
from pyflagser.
Hi @MandMarc,
Thank you for interest in this feature. I need to be honest, I did not touch the filtration generation at all, meaning I don't have much experience on this.
But, to explain how the filtration are generated for the moment is as follow:
- Go in
flagser
- There you have a file
algorithms.math
that describes the filtration in a kind of pseudo-code. - When you added you new filtration in this file, you can the run
build_custom_algorithms.sh
- This script will run a Python parser to convert
algorithms.math
pseudo-code intoflagser/include/algorithms.h
c code. - Then you can manually compile
pyflagser
from the root of the repository withpython -m pip install -e .
. - From there your new filtration should be available in theory.
I never tried to create a new filtration, so I don't know much of the pseudo-code syntax. But the rest, I could help in debug if necessary.
As you can understand, the filtration are hard-coded into the code. And if you want to add a new filtration, you are required to compile again the package. What should be necessary, is to add the possibility from Python to pass a filtration function.
In order to achieve this, we should define a common interface for filtration that matches what flagser
expects.
I think it is definitely doable, but as @ulupo said, currently we are really busy, I cannot give a specific time frame.
I can provide by end of the week, what I think the changes in the different parts of the code should be and if you are interested, you can start from there, otherwise, please let me some time to be able to implement this.
Best,
Julián
from pyflagser.
Hi again,
I give it a second though about the feature.
The filtration is a core part of the algorithm. This function is called extensively.
If we would want to provide a custom filtration, we would need to provide a callback function from Python to the C++ backend.
This is definitely doable for pybind11, but I am afraid about the performances implication. I opened a discussion in pybind11
about this, to see if I am right in thinking that performance will be highly impacted, or if I am wrong.
The reason I think this could have a big runtime impact is because, if I understood right the documentation, when you provide from Python a callback. Then in the C++ core, it will call the Python function and then the Python function will return the value to the C++ core. Hope I am clear in my explanation.
I will wait on their input to see if we should proceed by providing a callback from Python directly.
Otherwise, a different approach, would be to add to the bindings the possibility to add new filtrations. But even this will require to compile again the package.
I cannot see a good solution (good in term of performance and easy to use), but I will continue to think about this.
@MandMarc I will try to keep you updated and not delay to much this, but It could take time to have a smart solution. If on the meantime you can try the solution I posted before, I can provide you assistance.
from pyflagser.
Related Issues (20)
- Computations following an interrupted call fail HOT 5
- Support for filtration algos HOT 2
- Computations take a long time HOT 2
- Filtration algorithm vertex_degree produces segmentation fault HOT 2
- Zero values outside of the diagonal HOT 10
- Incorrect outputs of the flagser bindings.
- One dimensional output for empty persistence diagram HOT 3
- flagser_weighted does not terminate/takes forever when coeff > 2 HOT 5
- Relax condition on square shape on sparse input HOT 1
- Warnings and crashes for FlagserPersistence with n_jobs>1 HOT 2
- Feature request: Allow (read only) access to the directed flag complex via python HOT 16
- `save_weighted_flag` crashes (and is uncovered by tests) HOT 3
- flagser_memory support HOT 13
- `pyflagser.flagser_count_unweighted` crashes on really huge graphs HOT 24
- Drop support for Python 3.6 HOT 6
- ERROR pyflagser - ModuleNotFoundError: No module named 'pyflagser.modules' HOT 4
- error 'flagser/src/flagser-count.cpp' file not found HOT 1
- Error installing pyflagser in macOS 12.4 FileNotFoundError
- [BUG] Error installing pyflagser HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyflagser.