pub struct SinusoidalEmbeddings { /* private fields */ }Expand description
Embeddings layer that uses word embeddings with sinusoidal positions.
The word embeddings in this layer can be optimized, but the sinusoidal positions are generated on-the-fly.
Implementations§
Source§impl SinusoidalEmbeddings
impl SinusoidalEmbeddings
Sourcepub fn new<'a>(
vs: impl Borrow<PathExt<'a>>,
config: &impl WordEmbeddingsConfig,
p_norm: Option<f64>,
) -> Result<SinusoidalEmbeddings, TransformerError>
pub fn new<'a>( vs: impl Borrow<PathExt<'a>>, config: &impl WordEmbeddingsConfig, p_norm: Option<f64>, ) -> Result<SinusoidalEmbeddings, TransformerError>
Create piece embeddings with sinusoidal position embeddings.
If a p_norm is specified position embeddings are normalized
using this norm.
Trait Implementations§
Source§impl Debug for SinusoidalEmbeddings
impl Debug for SinusoidalEmbeddings
Auto Trait Implementations§
impl Freeze for SinusoidalEmbeddings
impl RefUnwindSafe for SinusoidalEmbeddings
impl Send for SinusoidalEmbeddings
impl !Sync for SinusoidalEmbeddings
impl Unpin for SinusoidalEmbeddings
impl UnwindSafe for SinusoidalEmbeddings
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> 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