![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
TensorFlow
hia_echo
这个作者很懒,什么都没留下…
展开
-
TensorFlow之计算交叉熵的函数 tf.nn.sparse_softmax_cross_entropy_with_logits
写在前面:起因是遇到一个错误:ValueError: Rank mismatch: Rank of labels (received 2) should equal rank of logits minus 1 (received 2).于是去了解接下来介绍的这两个函数。 tf.nn.sparse_softmax_cross_entropy_with_logits tf.nn.spa...原创 2018-11-28 10:57:18 · 6633 阅读 · 1 评论 -
TensorFlow之tf.map_fn()
tf.map_fn() 划重点:从0维度的 elems 中解压的张量列表上的映射。 map_fn( fn, elems, dtype=None, parallel_iterations=10, back_prop=True, swap_memory=False, infer_shape=True, name=None ) f...原创 2018-12-03 09:46:54 · 9305 阅读 · 1 评论 -
共享变量的使用——tf.get_variable()
共享变量的使用——tf.get_variable() with tf.variable_scope("test1", reuse=True): var = tf.get_variable("firstvar", shape=[2], dtype=tf.float32) tf.get_variable在创建变量时,会先检查图中是否已经创建过该名字的变量: 若没有创建过且reuse=Fal...原创 2019-01-04 21:53:49 · 455 阅读 · 0 评论