pub struct SinusoidalPositionalEncoding<T: Float + Send + Sync + 'static + ScalarOperand + FromPrimitive> { /* private fields */ }Expand description
Sinusoidal Positional Encoding (fixed, non-learnable) 正弦波位置エンコーディング(固定、学習不可)
Uses sinusoidal functions to encode positional information. 正弦波関数を使用して位置情報をエンコードします。
Implementations§
Source§impl<T> SinusoidalPositionalEncoding<T>where
T: Float + Debug + Default + FromPrimitive + ToPrimitive + Zero + 'static + Send + Sync + Copy + ScalarOperand + FromPrimitive,
impl<T> SinusoidalPositionalEncoding<T>where
T: Float + Debug + Default + FromPrimitive + ToPrimitive + Zero + 'static + Send + Sync + Copy + ScalarOperand + FromPrimitive,
Sourcepub fn new(max_length: usize, embedding_dim: usize) -> Self
pub fn new(max_length: usize, embedding_dim: usize) -> Self
Creates a new SinusoidalPositionalEncoding layer 新しいSinusoidalPositionalEncoding層を作成します
Sourcepub fn forward(&self, input: &Variable<T>) -> Variable<T>
pub fn forward(&self, input: &Variable<T>) -> Variable<T>
Forward pass of the SinusoidalPositionalEncoding layer SinusoidalPositionalEncoding層の順伝播
Sourcepub fn max_length(&self) -> usize
pub fn max_length(&self) -> usize
Returns the maximum sequence length 最大シーケンス長を返します
Sourcepub fn embedding_dim(&self) -> usize
pub fn embedding_dim(&self) -> usize
Returns the embedding dimension 埋め込み次元を返します
Trait Implementations§
Source§impl<T: Debug + Float + Send + Sync + 'static + ScalarOperand + FromPrimitive> Debug for SinusoidalPositionalEncoding<T>
impl<T: Debug + Float + Send + Sync + 'static + ScalarOperand + FromPrimitive> Debug for SinusoidalPositionalEncoding<T>
Source§impl<T> Module<T> for SinusoidalPositionalEncoding<T>where
T: Float + Debug + Default + FromPrimitive + ToPrimitive + Zero + 'static + Send + Sync + Copy + ScalarOperand + FromPrimitive,
impl<T> Module<T> for SinusoidalPositionalEncoding<T>where
T: Float + Debug + Default + FromPrimitive + ToPrimitive + Zero + 'static + Send + Sync + Copy + ScalarOperand + FromPrimitive,
Source§fn forward(&self, input: &Variable<T>) -> Variable<T>
fn forward(&self, input: &Variable<T>) -> Variable<T>
モジュールの順伝搬を実行します。
Performs the forward pass of the module.
Source§fn parameters(&self) -> Vec<Variable<T>>
fn parameters(&self) -> Vec<Variable<T>>
モジュールのパラメータへの参照を返します。
Returns a reference to the module’s parameters.
Auto Trait Implementations§
impl<T> Freeze for SinusoidalPositionalEncoding<T>
impl<T> RefUnwindSafe for SinusoidalPositionalEncoding<T>where
T: RefUnwindSafe,
impl<T> Send for SinusoidalPositionalEncoding<T>
impl<T> Sync for SinusoidalPositionalEncoding<T>
impl<T> Unpin for SinusoidalPositionalEncoding<T>
impl<T> UnwindSafe for SinusoidalPositionalEncoding<T>where
T: RefUnwindSafe,
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