pub struct SpectralAuditor {
pub n_probes: usize,
pub threshold: f64,
}Expand description
Generates random probe vectors and compares Laplacian quadratic forms between the full graph and its sparsifier.
Fields§
§n_probes: usizeNumber of random probes per audit.
threshold: f64Acceptable relative error threshold.
Implementations§
Source§impl SpectralAuditor
impl SpectralAuditor
Sourcepub fn audit_quadratic_form(
&self,
g_full: &SparseGraph,
g_spec: &SparseGraph,
n_probes: usize,
) -> AuditResult
pub fn audit_quadratic_form( &self, g_full: &SparseGraph, g_spec: &SparseGraph, n_probes: usize, ) -> AuditResult
Audit by comparing x^T L_full x vs x^T L_spec x for random x.
Each probe vector has i.i.d. standard-normal entries. The relative
error for each probe is |full - spec| / max(full, tiny).
Sourcepub fn audit_cuts(
&self,
g_full: &SparseGraph,
g_spec: &SparseGraph,
n_cuts: usize,
) -> AuditResult
pub fn audit_cuts( &self, g_full: &SparseGraph, g_spec: &SparseGraph, n_cuts: usize, ) -> AuditResult
Audit by comparing random cut values.
Generates n_cuts random binary partitions and checks that the
cut weight in the sparsifier is within (1 +/- threshold) of the
full graph cut weight.
Sourcepub fn audit_conductance(
&self,
g_full: &SparseGraph,
g_spec: &SparseGraph,
k_clusters: usize,
) -> AuditResult
pub fn audit_conductance( &self, g_full: &SparseGraph, g_spec: &SparseGraph, k_clusters: usize, ) -> AuditResult
Audit via random cluster conductance estimation.
Generates k_clusters random cluster indicator vectors and checks
spectral consistency.
Trait Implementations§
Source§impl Clone for SpectralAuditor
impl Clone for SpectralAuditor
Source§fn clone(&self) -> SpectralAuditor
fn clone(&self) -> SpectralAuditor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpectralAuditor
impl Debug for SpectralAuditor
Source§impl<'de> Deserialize<'de> for SpectralAuditor
impl<'de> Deserialize<'de> for SpectralAuditor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SpectralAuditor
impl RefUnwindSafe for SpectralAuditor
impl Send for SpectralAuditor
impl Sync for SpectralAuditor
impl Unpin for SpectralAuditor
impl UnsafeUnpin for SpectralAuditor
impl UnwindSafe for SpectralAuditor
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more