pub struct RecurrentOps;Expand description
Common operations for recurrent cells リカレントセル用共通操作
Implementations§
Source§impl RecurrentOps
impl RecurrentOps
Sourcepub fn init_weights<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>(
input_size: usize,
hidden_size: usize,
num_gates: usize,
) -> (Variable<T>, Variable<T>)
pub fn init_weights<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>( input_size: usize, hidden_size: usize, num_gates: usize, ) -> (Variable<T>, Variable<T>)
Initialize weights using Xavier/Glorot initialization Xavier/Glorot初期化で重みを初期化
Sourcepub fn init_bias<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>(
hidden_size: usize,
num_gates: usize,
) -> (Option<Variable<T>>, Option<Variable<T>>)
pub fn init_bias<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>( hidden_size: usize, num_gates: usize, ) -> (Option<Variable<T>>, Option<Variable<T>>)
Initialize bias バイアスを初期化
Sourcepub fn linear_transform<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>(
input: &Variable<T>,
weight: &Variable<T>,
bias: Option<&Variable<T>>,
) -> Variable<T>
pub fn linear_transform<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>( input: &Variable<T>, weight: &Variable<T>, bias: Option<&Variable<T>>, ) -> Variable<T>
Linear transformation: input @ weight^T + bias 線形変換: input @ weight^T + bias
Sourcepub fn matmul_variables<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>(
a: &Variable<T>,
b: &Variable<T>,
) -> Variable<T>
pub fn matmul_variables<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>( a: &Variable<T>, b: &Variable<T>, ) -> Variable<T>
Matrix multiplication for variables Variable用の行列乗算
Sourcepub fn add_variables<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>(
a: &Variable<T>,
b: &Variable<T>,
) -> Variable<T>
pub fn add_variables<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>( a: &Variable<T>, b: &Variable<T>, ) -> Variable<T>
Addition for variables Variable用の加算
Sourcepub fn multiply_variables<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>(
a: &Variable<T>,
b: &Variable<T>,
) -> Variable<T>
pub fn multiply_variables<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>( a: &Variable<T>, b: &Variable<T>, ) -> Variable<T>
Multiplication for variables Variable用の乗算
Sourcepub fn subtract_from_scalar<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>(
var: &Variable<T>,
scalar: T,
) -> Variable<T>
pub fn subtract_from_scalar<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>( var: &Variable<T>, scalar: T, ) -> Variable<T>
Subtract variable from scalar スカラーから変数を減算
Sourcepub fn transpose_variable<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>(
var: &Variable<T>,
) -> Variable<T>
pub fn transpose_variable<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>( var: &Variable<T>, ) -> Variable<T>
Transpose for variables Variable用の転置
Sourcepub fn sigmoid<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>(
var: &Variable<T>,
) -> Variable<T>
pub fn sigmoid<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>( var: &Variable<T>, ) -> Variable<T>
Sigmoid activation for variables Variable用のシグモイド活性化
Sourcepub fn tanh<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>(
var: &Variable<T>,
) -> Variable<T>
pub fn tanh<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>( var: &Variable<T>, ) -> Variable<T>
Tanh activation for variables Variable用のtanh活性化
Sourcepub fn slice_gates<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>(
gates: &Variable<T>,
gate_idx: usize,
hidden_size: usize,
) -> Variable<T>
pub fn slice_gates<T: Float + Send + Sync + Debug + 'static + ScalarOperand + FromPrimitive>( gates: &Variable<T>, gate_idx: usize, hidden_size: usize, ) -> Variable<T>
Slice gates from concatenated tensor 連結されたテンソルからゲートをスライス
Create zero hidden state ゼロ隠れ状態を作成
Auto Trait Implementations§
impl Freeze for RecurrentOps
impl RefUnwindSafe for RecurrentOps
impl Send for RecurrentOps
impl Sync for RecurrentOps
impl Unpin for RecurrentOps
impl UnwindSafe for RecurrentOps
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