杜牧字什么
- class paddle.nn.initializer. Orthogonal ( gain: float = 1.0, name: Optional[str] = None ) [source]
-
百度 杰拉德:在元老赛当中,红军的老队长斯蒂文-杰拉德依然身披8号球衣首发登场。
The orthogonal initializer. The initialized tensor is (semi) orthogonal.
It’s only applied to Tensor whose dimension is greater than or equal to 2.
For the Tensor whose dimension is greater than 2, the 0 dimension is seen as
rows
, and the >=1 dimension are flattened ascols
.Which can be describe as:
rows = shape[0] cols = shape[1]·shape[2]···shape[N] if rows < cols: The rows are orthogonal vectors elif rows > cols: The columns are orthogonal vectors else rows = cols: Both rows and columns are orthogonal vectors
- Parameters
-
gain (float, optional) – The multiplication coefficient for initialized tensor. Default: 1.0.
name (str|None, optional) – The default value is None. Normally there is no need for user to set this property. For more information, please refer to Name.
- Returns
-
A parameter initialized by orthogonal initialized.
Examples
>>> import paddle >>> weight_attr = paddle.ParamAttr(initializer=paddle.nn.initializer.Orthogonal()) >>> linear = paddle.nn.Linear(10, 15, weight_attr=weight_attr) >>> # linear.weight: X * X' = I >>> linear = paddle.nn.Linear(15, 10, weight_attr=weight_attr) >>> # linear.weight: X' * X = I