Comments (5)
But, I modified some weeks ago flagser library to better manages this arguments. Daniel already merged the changes.
I would prefer to make a PR integrating the new changes added in flagser, update the bindings, and we shall not encounter this issues in the future.
Go for it! Thanks :)
from pyflagser.
@gtauzin flagging this for your interest.
from pyflagser.
@ulupo thanks for reporting, I tried directly on flagser
to see if it also encounter this interminable run.
With the following code, I added a print for the generated vertices and edges in function flagser_weighted::_extract_weighted_graph
#!/usr/bin/env python
import numpy as np
import pyflagser
x = np.random.random((5, 5))
np.fill_diagonal(x, 0.)
print(x)
pyflagser.flagser_weighted(x, coeff=3)
Intermediate print:
x = [[0. 0.84707679 0.18398522 0.96259247 0.54167621]
[0.34772313 0. 0.97810088 0.72855808 0.27364796]
[0.18882756 0.89481899 0. 0.52133444 0.17973438]
[0.38915903 0.56670509 0.07425402 0. 0.60400914]
[0.81306144 0.907335 0.23578294 0.27208927 0. ]]
vertices = [0. 0. 0. 0. 0.]
edges = [[0. 1. 0.84707679]
[0. 2. 0.18398522]
[0. 3. 0.96259247]
[0. 4. 0.54167621]
[1. 0. 0.34772313]
[1. 2. 0.97810088]
[1. 3. 0.72855808]
[1. 4. 0.27364796]
[2. 0. 0.18882756]
[2. 1. 0.89481899]
[2. 3. 0.52133444]
[2. 4. 0.17973438]
[3. 0. 0.38915903]
[3. 1. 0.56670509]
[3. 2. 0.07425402]
[3. 4. 0.60400914]
[4. 0. 0.81306144]
[4. 1. 0.907335 ]
[4. 2. 0.23578294]
[4. 3. 0.27208927]]
Then I created a file to pass it directly to flagser test.txt.
And then run flagser
with coefficients enable:
./flagser-coefficients --out result_coeff_3.txt --modulus 3 --max-dim -1 --min-dim 0 --filtration max test.txt
The program finish almost instantly, you can check the result in result_coeff_3.txt
Seems that the issue is on pyflagser
let me know if there's an error in my procedure, I'll investigate if there's an error with the bindings.
from pyflagser.
@MonkeyBreaker thank you! Indeed I do not think this issue has a mathematical basis, and since the C++ code is immune it must be about the bindings. Thanks for looking into this.
from pyflagser.
Okay, seems I found out the issue.
In the past, flagser
manages options by command line arguments, and it forwards everywhere this arguments.
And of course, again, I failed on checking all possible functions that received a certain argument. I did not add test for different coeff
than 2, so I did not catch this.
The issue can be resolved by adding this in src/flagser_bindings.cpp
starting at line 29:
// Passing coeff as a command line argument
std::string str_modulus = std::to_string(modulus);
named_arguments["modulus"] = str_modulus.c_str();
If it's urgent I can create a PR just for adding this + a test of course :).
But, I modified some weeks ago flagser
library to better manages this arguments. Daniel already merged the changes.
I would prefer to make a PR integrating the new changes added in flagser
, update the bindings, and we shall not encounter this issues in the future.
What do you think ?
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
- 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
- feature request: custom filtration HOT 4
- 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.