0

在我的 TensorFlow 代码中,我已将几个参数连接到图表中的某些逻辑,但相应的 TensorBoard 可视化无法直接建立这些连接,而是仅指示包含范围之间的连接。

具体来说,我有

with tf.name_scope('params_structure'):
    is_train = tf.placeholder(tf.bool, [], name='is_train')
    keep_prob_later_param = tf.identity(FLAGS.keep_prob_later, name='keep_prob_later')
    keep_prob_early_param = tf.identity(FLAGS.keep_prob_early, name='keep_prob_early')
    keep_prob_input_param = tf.identity(FLAGS.keep_prob_input, name='keep_prob_input')

with tf.name_scope('structure_logic'):
    # Note that the summaries for these variables are the values used in training; not for computing stats
    with tf.name_scope('keep_prob_later_decay'):
        keep_prob_later_decay = tf.sub(1.0, tf.train.exponential_decay(1 - keep_prob_later_param, global_step,
                                                                       FLAGS.decay_steps,
                                                                       FLAGS.dropout_decay_rate, staircase=False))
    with tf.name_scope('keep_prob_early_decay'):
        keep_prob_early_decay = tf.sub(1.0, tf.train.exponential_decay(1 - keep_prob_early_param, global_step,
                                                                       FLAGS.decay_steps,
                                                                       FLAGS.dropout_decay_rate, staircase=False))
    with tf.name_scope('keep_prob_input_decay'):
        keep_prob_input_decay = tf.sub(1.0, tf.train.exponential_decay(1 - keep_prob_input_param, global_step,
                                                                       FLAGS.decay_steps,
                                                                       FLAGS.dropout_decay_rate, staircase=False))
    with tf.name_scope('keep_prob_all'):
        keep_prob_all = tf.identity(1.0)

    keep_prob_later = tf.cond(is_train, lambda: keep_prob_later_decay, lambda: keep_prob_all)
    keep_prob_early = tf.cond(is_train, lambda: keep_prob_early_decay, lambda: keep_prob_all)
    keep_prob_input = tf.cond(is_train, lambda: keep_prob_input_decay, lambda: keep_prob_all)

在我的 TensorBoard 可视化中,我按预期看到了所有这些元素,但是keep_prob_..._params 和相应keep_prob_..._decay操作之间的连接尚未建立。相反,我只获得包含范围之间的连接作为一个组(例如,从params_structure下面突出显示的到所有 keep_prob_..._decay操作):

在此处输入图像描述

连接is_train到条件操作中也是如此:只有整个包含范围(上面突出显示)是连接的。

如何确保我的图形元素之间的连接,而不仅仅是它们的封闭范围,在 TensorBoard 中表示?


请注意,这不仅仅是一个强制完整性的问题:就目前而言,TensorBoard 表示完全无法确定哪些params_structure元素连接到哪些structure_logic元素:它可能是任何一个、全部,甚至没有!

4

1 回答 1

1

TensorBoard 必须选择表示,因为显示所有真实连接将是不可读的。这就是名称范围如此有用的原因:您可以查看整个图表,然后放大您感兴趣的元素。

但是,正如您所说,使用名称范围 TensorBoard 将显示两个框之间的一个大连接param_structuresstructure_logic(在此连接中有 9 个张量)。

TensorBoard 表示完全无法确定哪个 params_structure 元素连接到哪个 structure_logic 元素:它可能是任何一个,全部,甚至没有!

这是错误的,Graph 的所有信息都被表示出来了。
虽然没有以图形方式显示,但是当您单击节点并看到右上角的框时,会写入params_structure/keep_prob_later和之间的连接。 在“输出”类别中,您可以看到节点。structure_logic/keep_prob_later_decayparams_structure/keep_prob_later
structure_logic/keep_prob_later_decay

节点描述


如果你真的想看到连接,你应该把节点keep_prob_later放在名称范围内structure_logic/keep_prob_later_decay


PS:

请注意,这不仅仅是强制完整性的问题。

那个让我笑了:)

于 2016-06-09T08:35:48.923 回答