tensorflow.contrib.distributions.RelaxedOneHotCategorical变量参数详解

tensorflow.contrib.distributions.RelaxedOneHotCategorical

RelaxedOneHotCategorical是随机概率向量上的分布,这些向量的正实值和为一,连续逼近一个OneHotCategorical。近似程度由温度控制:当温度变为0时,RelaxedOneHotCategorical变得离散,分布由logits或probs参数描述,当温度变为无穷大时,RelaxedOneHotCategorical变为常数分布,与常数向量(1/event_size,…,1/event_size)相同。

RelaxedOneHotCategorical分布同时作为Gumbel Softmax(Jang等人,2016, https://arxiv.org/abs/1611.01144)和Concrete(Maddison等人,2016)分布引入,用作分类单热分布的重新参数化连续近似。如果你使用这个分布,请引用这两篇论文:

[1] E. Jang, S. Gu, and B. Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.

[2] C. J. Maddison, D. Tarlow, and T. Minka, “A* sampling,” in Advances in Neural Information Processing Systems, 2014, pp. 3086– 3094.

Args

temperature: An 0-D Tensor, representing the temperature of a set of RelaxedOneHotCategorical distributions. The temperature should be positive.

一个0-D的张量,表示RelaxedOneHotCategorical分布的温度,应该是正的。

logits:

An N-D Tensor, N >= 1, representing the log probabilities of a set of RelaxedOneHotCategorical distributions. The first N - 1 dimensions index into a batch of independent distributions and the last dimension represents a vector of logits for each class. Only one of logits or probs should be passed in.

第一个“N-1”维索引成一批独立的分布,最后一个维表示每个类的logit向量。logits和probs只能传入一个。

probs:

An N-D Tensor, N >= 1, representing the probabilities of a set of RelaxedOneHotCategorical distributions. The first N - 1 dimensions index into a batch of independent distributions and the last dimension represents a vector of probabilities for each class. Only one of logits or probs should be passed in.

第一个“N-1”维索引为一批独立分布,最后一个维表示每个类的概率向量。logits和probs只能传入一个

dtype:

The type of the event samples (default: inferred from logits/probs).

validate_args:

Unused in this distribution.

allow_nan_stats:

Python bool, default True. If False, raise an exception if a statistic (e.g. mean/mode/etc…) is undefined for any batch member. If True, batch members with valid parameters leading to undefined statistics will return NaN for this statistic.

name:

A name for this distribution (optional).

参考:https://tensorflow.google.cn/probability/api_docs/python/tfp/distributions/RelaxedOneHotCategorical

https://zhuanlan.zhihu.com/p/50065712

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值