Giter Club home page Giter Club logo

Comments (2)

kalikhademi avatar kalikhademi commented on May 27, 2024

Hi,

I am using the Persim module to produce the persistent image based on the diagrams generated by RIPS (https://github.com/scikit-tda/ripser.py).

`rips = Rips(maxdim=0)

dgms = rips.fit_transform(data)

plot_diagrams(dgms, show=True)

pim = PersImage(pixels =[100,100],spread =1)

imgs = pim.transform(dgms)

plt.figure(figsize=(15,15))

pim.show(imgs)`

However, I get the following runtime warning:
`Rips(maxdim=0, thresh=inf, coeff=2, do_cocycles=False, n_perm = None, verbose=True)
I am done with rips
PersImage(pixels=[100, 100], spread=1, specs=None, kernel_type="gaussian", weighting_type="linear")
Traceback (most recent call last):

File "/Users/kianamac/Desktop/mahdi files/index.py", line 44, in
imgs = pim.transform(dgms)

File "/Users/kianamac/Applications/anaconda3/lib/python3.8/site-packages/persim/images.py", line 104, in transform
imgs = [self._transform(dgm) for dgm in landscapes]

File "/Users/kianamac/Applications/anaconda3/lib/python3.8/site-packages/persim/images.py", line 104, in
imgs = [self._transform(dgm) for dgm in landscapes]

File "/Users/kianamac/Applications/anaconda3/lib/python3.8/site-packages/persim/images.py", line 119, in _transform
xs_lower = np.linspace(minBD, maxBD, self.nx)

File "<array_function internals>", line 5, in linspace

File "/Users/kianamac/Applications/anaconda3/lib/python3.8/site-packages/numpy/core/function_base.py", line 153, in linspace
y *= step

RuntimeWarning: invalid value encountered in multiply`

Would you please help me to understand what could be the source of the problem?

Thanks,

from persim.

jakipatryk avatar jakipatryk commented on May 27, 2024

Hi,

I am using the Persim module to produce the persistent image based on the diagrams generated by RIPS (https://github.com/scikit-tda/ripser.py).

`rips = Rips(maxdim=0)

dgms = rips.fit_transform(data)

plot_diagrams(dgms, show=True)

pim = PersImage(pixels =[100,100],spread =1)

imgs = pim.transform(dgms)

plt.figure(figsize=(15,15))

pim.show(imgs)`

However, I get the following runtime warning: `Rips(maxdim=0, thresh=inf, coeff=2, do_cocycles=False, n_perm = None, verbose=True) I am done with rips PersImage(pixels=[100, 100], spread=1, specs=None, kernel_type="gaussian", weighting_type="linear") Traceback (most recent call last):

File "/Users/kianamac/Desktop/mahdi files/index.py", line 44, in imgs = pim.transform(dgms)

File "/Users/kianamac/Applications/anaconda3/lib/python3.8/site-packages/persim/images.py", line 104, in transform imgs = [self._transform(dgm) for dgm in landscapes]

File "/Users/kianamac/Applications/anaconda3/lib/python3.8/site-packages/persim/images.py", line 104, in imgs = [self._transform(dgm) for dgm in landscapes]

File "/Users/kianamac/Applications/anaconda3/lib/python3.8/site-packages/persim/images.py", line 119, in _transform xs_lower = np.linspace(minBD, maxBD, self.nx)

File "<array_function internals>", line 5, in linspace

File "/Users/kianamac/Applications/anaconda3/lib/python3.8/site-packages/numpy/core/function_base.py", line 153, in linspace y *= step

RuntimeWarning: invalid value encountered in multiply`

Would you please help me to understand what could be the source of the problem?

Thanks,

@kalikhademi Not sure if it is still relevant, but I think the issue is that with Vietoris-Rips filtration, in dimension 0 all persistence pairs have birth=0, and thus there is not really a notion of 2D image there (as range of birth in birth-persistence diagram is [0, 0]).

from persim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.