ai.onnx.ml - 归一化器 (Normalizer)

归一化器 (Normalizer) - 1 (ai.onnx.ml)

版本

该算子的此版本**自 ai.onnx.ml 域的 1 版本起**可用。

摘要

Normalize the input.  There are three normalization modes, which have the corresponding formulas,
defined using element-wise infix operators '/' and '^' and tensor-wide functions 'max' and 'sum':<br>

最大值: Y = X / max(X)
L1: Y = X / sum(X)
L2: Y = sqrt(X^2 / sum(X^2))
在所有模式下,如果除数为零,则 Y == X。
对于批次,即 [N,C] 张量,归一化沿 C 轴进行。换句话说,批次的每一行都独立归一化。

属性

  • norm - 字符串 (默认为 'MAX')

    ‘MAX’、‘L1’、‘L2’ 之一

输入

  • X (异构) - T

    要编码的数据,形状为 [N,C] 或 [C] 的张量

输出

  • Y (异构) - tensor(float)

    编码后的输出数据

类型约束

  • T 在 ( tensor(double), tensor(float), tensor(int32), tensor(int64) ) 中

    输入必须是数值类型的张量。