pub struct JsRuvectorLayer { /* private fields */ }Expand description
Graph Neural Network layer for HNSW topology
Implementations§
Source§impl JsRuvectorLayer
impl JsRuvectorLayer
Sourcepub fn new(
input_dim: usize,
hidden_dim: usize,
heads: usize,
dropout: f32,
) -> Result<JsRuvectorLayer, JsValue>
pub fn new( input_dim: usize, hidden_dim: usize, heads: usize, dropout: f32, ) -> Result<JsRuvectorLayer, JsValue>
Create a new GNN layer
§Arguments
input_dim- Dimension of input node embeddingshidden_dim- Dimension of hidden representationsheads- Number of attention headsdropout- Dropout rate (0.0 to 1.0)
Sourcepub fn forward(
&self,
node_embedding: Vec<f32>,
neighbor_embeddings: JsValue,
edge_weights: Vec<f32>,
) -> Result<Vec<f32>, JsValue>
pub fn forward( &self, node_embedding: Vec<f32>, neighbor_embeddings: JsValue, edge_weights: Vec<f32>, ) -> Result<Vec<f32>, JsValue>
Sourcepub fn output_dim(&self) -> usize
pub fn output_dim(&self) -> usize
Get the output dimension of this layer
Trait Implementations§
Source§impl From<JsRuvectorLayer> for JsValue
impl From<JsRuvectorLayer> for JsValue
Source§fn from(value: JsRuvectorLayer) -> Self
fn from(value: JsRuvectorLayer) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for JsRuvectorLayer
impl FromWasmAbi for JsRuvectorLayer
Source§impl IntoWasmAbi for JsRuvectorLayer
impl IntoWasmAbi for JsRuvectorLayer
Source§impl LongRefFromWasmAbi for JsRuvectorLayer
impl LongRefFromWasmAbi for JsRuvectorLayer
Source§impl OptionFromWasmAbi for JsRuvectorLayer
impl OptionFromWasmAbi for JsRuvectorLayer
Source§impl OptionIntoWasmAbi for JsRuvectorLayer
impl OptionIntoWasmAbi for JsRuvectorLayer
Source§impl RefFromWasmAbi for JsRuvectorLayer
impl RefFromWasmAbi for JsRuvectorLayer
Source§type Anchor = RcRef<JsRuvectorLayer>
type Anchor = RcRef<JsRuvectorLayer>
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 RefMutFromWasmAbi for JsRuvectorLayer
impl RefMutFromWasmAbi for JsRuvectorLayer
Source§impl TryFromJsValue for JsRuvectorLayer
impl TryFromJsValue for JsRuvectorLayer
Source§impl VectorFromWasmAbi for JsRuvectorLayer
impl VectorFromWasmAbi for JsRuvectorLayer
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[JsRuvectorLayer]>
Source§impl VectorIntoWasmAbi for JsRuvectorLayer
impl VectorIntoWasmAbi for JsRuvectorLayer
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[JsRuvectorLayer]>) -> Self::Abi
Source§impl WasmDescribeVector for JsRuvectorLayer
impl WasmDescribeVector for JsRuvectorLayer
impl SupportsConstructor for JsRuvectorLayer
impl SupportsInstanceProperty for JsRuvectorLayer
impl SupportsStaticProperty for JsRuvectorLayer
Auto Trait Implementations§
impl Freeze for JsRuvectorLayer
impl RefUnwindSafe for JsRuvectorLayer
impl Send for JsRuvectorLayer
impl Sync for JsRuvectorLayer
impl Unpin for JsRuvectorLayer
impl UnwindSafe for JsRuvectorLayer
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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.