Tensorflow 中 RNN softmax输出层采样 tf.multinomial(logits, num_samples)
来源:互联网 发布:json 双引号 编辑:程序博客网 时间:2024/04/28 23:49
Tensorflow 中,想要使用sequence to sequence 模型,在RNN的输出端采样(sampling),可以在softmax层之后,做简单的log p 再用tf.multinomial()来实现:
tf.multinomial(logits, num_samples, seed=None, name=None)
例如:# samples has shape [1, 5], where each value is either 0 or 1 with equal# probability.samples = tf.multinomial(tf.log([[10., 10.]]), 5)
Args:
logits
: 2-D Tensor with shape[batch_size, num_classes]
. Each slice[i, :]
represents the unnormalized log probabilities for all classes.num_samples
: 0-D. Number of independent samples to draw for each row slice.seed
: A Python integer. Used to create a random seed for the distribution. Seetf.set_random_seed
for behavior.name
: Optional name for the operation.
Returns:
The drawn samples of shape [batch_size, num_samples]
.
Defined in tensorflow/python/ops/random_ops.py
.
0 1
- Tensorflow 中 RNN softmax输出层采样 tf.multinomial(logits, num_samples)
- RNN中输出端的sample采样
- tensorflow sparse-softmax-cross-entropy-with-logits nan
- tensorflow教程:tf.contrib.rnn.DropoutWrapper
- TensorFlow学习之路(1): correct = tf.nn.in_top_k(logits, labels, k)
- caffe中Softmax层
- tf.multinomial()函数的理解
- tensorflow softmax输出只有0或1
- TensorFlow学习笔记之tf.nn.softmax()与tf.nn.softmax_cross_entropy_with_logits的用法
- tensorflow 中tf.concat()用法
- TensorFlow中 tf.nn.embedding_lookup
- TensorFlow:简单的卷积层、池化层(采样层)示例
- TensorFlow Softmax
- 关于sampling softmax 中重要性采样的论文阅读笔记
- Tensorflow CNN(两层卷积+全连接+softmax)
- TensorFlow中RNN样例代码详解
- Tensorflow中Demo学习:RNN语言模型
- tensorflow中tf.maximum,tf.minimum,tf.argmax,tf.argmain的对比
- 微信公众平台开发-access_token获取及应用(含源码)
- 高可用可伸缩架构实用经验谈
- WEB前端技术_JavaScript学习_1
- IO流其他类
- 二分法查找 各种版本。。。
- Tensorflow 中 RNN softmax输出层采样 tf.multinomial(logits, num_samples)
- 噩梦射手(SurvivalShooter)教程(七)
- nginx 配置缓存压缩 expires gzip
- JSP四个域对象—— pageContext, request, session, application
- Android okHttp拦截请求头和响应头
- webstorm 2016破解
- iOS学习笔记-048.UINavigationController——导航控制器
- Tomcat服务器原理详解:三部曲
- Kotlin开发Android入门(一)