pub struct WasmSlicedWasserstein { /* private fields */ }Expand description
Sliced Wasserstein distance calculator for WASM
Implementations§
Source§impl WasmSlicedWasserstein
impl WasmSlicedWasserstein
Sourcepub fn new(num_projections: usize) -> Self
pub fn new(num_projections: usize) -> Self
Create a new Sliced Wasserstein calculator
@param num_projections - Number of random 1D projections (100-1000 typical)
Sourcepub fn with_power(self, p: f64) -> Self
pub fn with_power(self, p: f64) -> Self
Set Wasserstein power (1 for W1, 2 for W2)
Trait Implementations§
Source§impl From<WasmSlicedWasserstein> for JsValue
impl From<WasmSlicedWasserstein> for JsValue
Source§fn from(value: WasmSlicedWasserstein) -> Self
fn from(value: WasmSlicedWasserstein) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for WasmSlicedWasserstein
impl FromWasmAbi for WasmSlicedWasserstein
Source§impl IntoWasmAbi for WasmSlicedWasserstein
impl IntoWasmAbi for WasmSlicedWasserstein
Source§impl RefFromWasmAbi for WasmSlicedWasserstein
impl RefFromWasmAbi for WasmSlicedWasserstein
Source§type Anchor = RcRef<WasmSlicedWasserstein>
type Anchor = RcRef<WasmSlicedWasserstein>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl VectorFromWasmAbi for WasmSlicedWasserstein
impl VectorFromWasmAbi for WasmSlicedWasserstein
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[WasmSlicedWasserstein]>
Source§impl VectorIntoWasmAbi for WasmSlicedWasserstein
impl VectorIntoWasmAbi for WasmSlicedWasserstein
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[WasmSlicedWasserstein]>) -> Self::Abi
Source§impl WasmDescribeVector for WasmSlicedWasserstein
impl WasmDescribeVector for WasmSlicedWasserstein
impl SupportsConstructor for WasmSlicedWasserstein
impl SupportsInstanceProperty for WasmSlicedWasserstein
impl SupportsStaticProperty for WasmSlicedWasserstein
Auto Trait Implementations§
impl Freeze for WasmSlicedWasserstein
impl RefUnwindSafe for WasmSlicedWasserstein
impl Send for WasmSlicedWasserstein
impl Sync for WasmSlicedWasserstein
impl Unpin for WasmSlicedWasserstein
impl UnwindSafe for WasmSlicedWasserstein
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> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.