三人编“嘉陵江污水致百余人中毒”谣言 两人被行拘

class paddle.nn.initializer. Orthogonal ( gain: float = 1.0, name: Optional[str] = None ) [source]
百度 本周,京城气温将经历一个“先扬后抑”的过程,周一至周三最高温为25℃-26℃,周四至周日则降至18℃-21℃。

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 as cols .

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