codecamp

TensorFlow函数教程:tf.nn.l2_normalize

tf.nn.l2_normalize函数

tf.nn.l2_normalize(
    x,
    axis=None,
    epsilon=1e-12,
    name=None,
    dim=None
)

定义在:tensorflow/python/ops/nn_impl.py.

请参阅指南:神经网络>规范化

使用L2范数沿维度axis规范化.(不赞成使用的参数)

一些参数已被弃用.它们将在未来版本中删除.更新说明:不推荐使用dim,而是使用axis.

对于axis = 0的1-D张量,计算如下:

output = x / sqrt(max(sum(x**2), epsilon))

对于具有更多维度的x,沿着维度axis独立地规范化每个1-D切片.

参数:

  • x:一个Tensor.
  • axis:规范化的维度.标量或整数向量.
  • epsilon:规范化的下限值.如果norm <sqrt(epsilon),将使用sqrt(epsilon)作为除数.
  • name:此操作的名称(可选).
  • dim:axis的不推荐别名.

返回:

一个Tensor,与x具有相同的shape.

TensorFlow函数教程:tf.nn.l2_loss
TensorFlow函数教程:tf.nn.leaky_relu
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

TensorFlow 函数介绍

TensorFlow 函数模块:tf

TensorFlow的image模块

TensorFlow使用之tf.io

TensorFlow使用之tf.keras

TensorFlow函数教程:tf.keras.applications

TensorFlow函数教程:tf.keras.backend

TensorFlow使用之tf.metrics

TensorFlow使用之tf.nn

TensorFlow使用之tf.python_io

TensorFlow 功能函数

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }