本文簡要介紹python語言中 torch.nn.init.orthogonal_
的用法。
用法:
torch.nn.init.orthogonal_(tensor, gain=1)
tensor-n 維
torch.Tensor
,其中gain-可選比例因子
用(半)正交矩陣填充輸入
Tensor
,如Exact solutions to the nonlinear dynamics of learning in deep linear neural networks
- Saxe, A. et al 中所述。 (2013)。輸入張量必須至少有 2 個維度,對於超過 2 個維度的張量,尾隨維度會被展平。例子
>>> w = torch.empty(3, 5) >>> nn.init.orthogonal_(w)
參數:
相關用法
- Python PyTorch orthogonal用法及代碼示例
- Python PyTorch ones_用法及代碼示例
- Python PyTorch optimize_for_inference用法及代碼示例
- Python PyTorch ones_like用法及代碼示例
- Python PyTorch outer用法及代碼示例
- Python PyTorch ones用法及代碼示例
- Python PyTorch one_hot用法及代碼示例
- Python PyTorch frexp用法及代碼示例
- Python PyTorch jvp用法及代碼示例
- Python PyTorch cholesky用法及代碼示例
- Python PyTorch vdot用法及代碼示例
- Python PyTorch ELU用法及代碼示例
- Python PyTorch ScaledDotProduct.__init__用法及代碼示例
- Python PyTorch gumbel_softmax用法及代碼示例
- Python PyTorch get_tokenizer用法及代碼示例
- Python PyTorch saved_tensors_hooks用法及代碼示例
- Python PyTorch positive用法及代碼示例
- Python PyTorch renorm用法及代碼示例
- Python PyTorch AvgPool2d用法及代碼示例
- Python PyTorch MaxUnpool3d用法及代碼示例
- Python PyTorch Bernoulli用法及代碼示例
- Python PyTorch Tensor.unflatten用法及代碼示例
- Python PyTorch Sigmoid用法及代碼示例
- Python PyTorch Tensor.register_hook用法及代碼示例
- Python PyTorch ShardedEmbeddingBagCollection.named_parameters用法及代碼示例
注:本文由純淨天空篩選整理自pytorch.org大神的英文原創作品 torch.nn.init.orthogonal_。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。