如何在 tf.contrib.layers.batch_norm 中给出 beta 和 gamma [英] How to give beta and gamma in tf.contrib.layers.batch_norm

查看:56
本文介绍了如何在 tf.contrib.layers.batch_norm 中给出 beta 和 gamma的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 tensorflow 提供的归一化层.在那个函数中,有一个字段,用于指定我们使用的是 beta 值还是 gamma 值.

I'm trying to use normalization layer given by tensorflow. In that function, there is a field to specify whether we are using beta or gamma values.

center: 如果为 True,则减去 beta.如果为 False,则忽略 beta.

center: If True, subtract beta. If False, beta is ignored.

scale: 如果为 True,则乘以 gamma.如果为 False,则不使用 gamma.当下一层是线性的(例如 nn.relu),这可以被禁用,因为缩放可以由下一层完成.

scale: If True, multiply by gamma. If False, gamma is not used. When the next layer is linear (also e.g. nn.relu), this can be disabled since the scaling can be done by the next layer.

但是没有地方可以将 betagamma 值输入到函数中.

But there is nowhere to input beta and gamma values into the function.

我需要知道如何输入 betagamma 的值?

I need to know how can I input values for beta and gamma..?

推荐答案

您提供的链接已将函数指定为 tf.contrib.layers.batch_norm(*args, **kwargs).

The link you provided has specified the function as tf.contrib.layers.batch_norm(*args, **kwargs).

看起来您应该能够将 betagamma 作为 keyword arguments**kwargs 传递,例如这个:

Looks like you should be able to pass beta and gamma as keyword arguments or **kwargs like this:

tf.contrib.layers.batch_norm(beta=value, gamma=value)

这篇关于如何在 tf.contrib.layers.batch_norm 中给出 beta 和 gamma的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆