pub struct PersistenceImage { /* private fields */ }Expand description
Persistence image: a stable vector representation of persistence diagrams.
Maps persistence diagrams to a 2D grid image by placing a Gaussian kernel centered at each persistence point (birth, persistence) and integrating over grid cells.
§References
Adams, H., et al. (2017). Persistence images: A stable vector representation of persistent homology. JMLR, 18(8), 1-35.
Implementations§
Source§impl PersistenceImage
impl PersistenceImage
Sourcepub fn new(
resolution: usize,
dimension: usize,
sigma: f64,
weight_type: PersistenceWeight,
) -> Result<Self>
pub fn new( resolution: usize, dimension: usize, sigma: f64, weight_type: PersistenceWeight, ) -> Result<Self>
Create a new PersistenceImage computer
§Arguments
resolution- Grid resolution (resolution × resolution)dimension- Homological dimension to usesigma- Gaussian kernel bandwidthweight_type- Weight function
Sourcepub fn transform(&self, diagram: &PersistenceDiagram) -> Result<Array2<f64>>
pub fn transform(&self, diagram: &PersistenceDiagram) -> Result<Array2<f64>>
Transform a diagram using this image’s configuration
Sourcepub fn with_birth_range(self, min: f64, max: f64) -> Self
pub fn with_birth_range(self, min: f64, max: f64) -> Self
Set the birth range for the image
Sourcepub fn with_persistence_range(self, min: f64, max: f64) -> Self
pub fn with_persistence_range(self, min: f64, max: f64) -> Self
Set the persistence range for the image
Auto Trait Implementations§
impl Freeze for PersistenceImage
impl RefUnwindSafe for PersistenceImage
impl Send for PersistenceImage
impl Sync for PersistenceImage
impl Unpin for PersistenceImage
impl UnsafeUnpin for PersistenceImage
impl UnwindSafe for PersistenceImage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.