pub struct HardNegativeMiner { /* private fields */ }Expand description
Hard negative miner for selecting informative negatives
Implementations§
Source§impl HardNegativeMiner
impl HardNegativeMiner
pub fn into_reference( val: HardNegativeMiner, env: Env, ) -> Result<Reference<HardNegativeMiner>>
pub fn into_instance(self, env: Env) -> Result<ClassInstance<HardNegativeMiner>>
Source§impl HardNegativeMiner
impl HardNegativeMiner
Sourcepub fn new(strategy: MiningStrategy) -> Self
pub fn new(strategy: MiningStrategy) -> Self
Sourcepub fn with_margin(strategy: MiningStrategy, margin: f64) -> Self
pub fn with_margin(strategy: MiningStrategy, margin: f64) -> Self
Create with margin (for semi-hard mining)
Sourcepub fn with_temperature(strategy: MiningStrategy, temperature: f64) -> Self
pub fn with_temperature(strategy: MiningStrategy, temperature: f64) -> Self
Create with temperature (for distance-weighted mining)
Sourcepub fn mine(
&self,
anchor: Float32Array,
positive: Float32Array,
candidates: Vec<Float32Array>,
num_negatives: u32,
) -> Vec<u32>
pub fn mine( &self, anchor: Float32Array, positive: Float32Array, candidates: Vec<Float32Array>, num_negatives: u32, ) -> Vec<u32>
Trait Implementations§
Source§impl FromNapiMutRef for HardNegativeMiner
impl FromNapiMutRef for HardNegativeMiner
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for HardNegativeMiner
impl FromNapiRef for HardNegativeMiner
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl FromNapiValue for &HardNegativeMiner
impl FromNapiValue for &HardNegativeMiner
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl FromNapiValue for &mut HardNegativeMiner
impl FromNapiValue for &mut HardNegativeMiner
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl ObjectFinalize for HardNegativeMiner
impl ObjectFinalize for HardNegativeMiner
Source§impl ToNapiValue for HardNegativeMiner
impl ToNapiValue for HardNegativeMiner
Source§unsafe fn to_napi_value(
env: napi_env,
val: HardNegativeMiner,
) -> Result<napi_value>
unsafe fn to_napi_value( env: napi_env, val: HardNegativeMiner, ) -> Result<napi_value>
Safety Read more
Source§impl TypeName for &HardNegativeMiner
impl TypeName for &HardNegativeMiner
Source§impl TypeName for &mut HardNegativeMiner
impl TypeName for &mut HardNegativeMiner
Source§impl TypeName for HardNegativeMiner
impl TypeName for HardNegativeMiner
Source§impl ValidateNapiValue for &HardNegativeMiner
impl ValidateNapiValue for &HardNegativeMiner
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut HardNegativeMiner
impl ValidateNapiValue for &mut HardNegativeMiner
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for HardNegativeMiner
impl RefUnwindSafe for HardNegativeMiner
impl Send for HardNegativeMiner
impl Sync for HardNegativeMiner
impl Unpin for HardNegativeMiner
impl UnsafeUnpin for HardNegativeMiner
impl UnwindSafe for HardNegativeMiner
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