Enum google_api_proto::google::cloud::aiplatform::v1beta1::feature_view::index_config::DistanceMeasureType
source · #[repr(i32)]pub enum DistanceMeasureType {
Unspecified = 0,
SquaredL2Distance = 1,
CosineDistance = 2,
DotProductDistance = 3,
}
Expand description
The distance measure used in nearest neighbor search.
Variants§
Unspecified = 0
Should not be set.
SquaredL2Distance = 1
Euclidean (L_2) Distance.
CosineDistance = 2
Cosine Distance. Defined as 1 - cosine similarity.
We strongly suggest using DOT_PRODUCT_DISTANCE + UNIT_L2_NORM instead of COSINE distance. Our algorithms have been more optimized for DOT_PRODUCT distance which, when combined with UNIT_L2_NORM, is mathematically equivalent to COSINE distance and results in the same ranking.
DotProductDistance = 3
Dot Product Distance. Defined as a negative of the dot product.
Implementations§
source§impl DistanceMeasureType
impl DistanceMeasureType
sourcepub fn from_i32(value: i32) -> Option<DistanceMeasureType>
👎Deprecated: Use the TryFrom<i32> implementation instead
pub fn from_i32(value: i32) -> Option<DistanceMeasureType>
Converts an i32
to a DistanceMeasureType
, or None
if value
is not a valid variant.
source§impl DistanceMeasureType
impl DistanceMeasureType
sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
source§impl Clone for DistanceMeasureType
impl Clone for DistanceMeasureType
source§fn clone(&self) -> DistanceMeasureType
fn clone(&self) -> DistanceMeasureType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DistanceMeasureType
impl Debug for DistanceMeasureType
source§impl Default for DistanceMeasureType
impl Default for DistanceMeasureType
source§fn default() -> DistanceMeasureType
fn default() -> DistanceMeasureType
source§impl From<DistanceMeasureType> for i32
impl From<DistanceMeasureType> for i32
source§fn from(value: DistanceMeasureType) -> i32
fn from(value: DistanceMeasureType) -> i32
source§impl Hash for DistanceMeasureType
impl Hash for DistanceMeasureType
source§impl Ord for DistanceMeasureType
impl Ord for DistanceMeasureType
source§fn cmp(&self, other: &DistanceMeasureType) -> Ordering
fn cmp(&self, other: &DistanceMeasureType) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for DistanceMeasureType
impl PartialEq for DistanceMeasureType
source§fn eq(&self, other: &DistanceMeasureType) -> bool
fn eq(&self, other: &DistanceMeasureType) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for DistanceMeasureType
impl PartialOrd for DistanceMeasureType
source§fn partial_cmp(&self, other: &DistanceMeasureType) -> Option<Ordering>
fn partial_cmp(&self, other: &DistanceMeasureType) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<i32> for DistanceMeasureType
impl TryFrom<i32> for DistanceMeasureType
§type Error = DecodeError
type Error = DecodeError
source§fn try_from(value: i32) -> Result<DistanceMeasureType, DecodeError>
fn try_from(value: i32) -> Result<DistanceMeasureType, DecodeError>
impl Copy for DistanceMeasureType
impl Eq for DistanceMeasureType
impl StructuralPartialEq for DistanceMeasureType
Auto Trait Implementations§
impl Freeze for DistanceMeasureType
impl RefUnwindSafe for DistanceMeasureType
impl Send for DistanceMeasureType
impl Sync for DistanceMeasureType
impl Unpin for DistanceMeasureType
impl UnwindSafe for DistanceMeasureType
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request