如何对张量板的可学习参数进行分组?
How to group learnable parameters for tensorboard?
我通常在 tensorflow 中按以下方式构造我的可学习参数:
learnable_weights = {
'w1': tf.get_variable(...),
...
'wn': tf.get_variable(...),
}
learnable_biases = {
'bc1': tf.get_variable(...),
...
'bd3': tf.get_variable(...)
}
我最近开始遇到的问题是张量板图拥塞,我在辅助节点中有很多权重(这是大图的一部分,这些节点的数量更大):
我试图将它们与 tf.name_scope
分组。像这样:
with tf.name_scope('learnable_params'):
learnable_weights = {...}
learnable_biases = {...}
但这对张量板中的图形没有影响。
任何原因或更好的建议如何对可学习的参数进行分组,以便它们不会使张量板混乱?
您可以尝试使用 variable_scope
而不是 name_scope
。通过 get_variable
创建的 AFAIK 变量会忽略 name_scope
,如果这也适用于 Tensorboard 中的图形组织,我不会感到惊讶。我只使用 variable_scope
来包装任何创建变量的东西,我从来没有遇到过 "unorganized" 变量的这些问题。
我通常在 tensorflow 中按以下方式构造我的可学习参数:
learnable_weights = {
'w1': tf.get_variable(...),
...
'wn': tf.get_variable(...),
}
learnable_biases = {
'bc1': tf.get_variable(...),
...
'bd3': tf.get_variable(...)
}
我最近开始遇到的问题是张量板图拥塞,我在辅助节点中有很多权重(这是大图的一部分,这些节点的数量更大):
我试图将它们与 tf.name_scope
分组。像这样:
with tf.name_scope('learnable_params'):
learnable_weights = {...}
learnable_biases = {...}
但这对张量板中的图形没有影响。
任何原因或更好的建议如何对可学习的参数进行分组,以便它们不会使张量板混乱?
您可以尝试使用 variable_scope
而不是 name_scope
。通过 get_variable
创建的 AFAIK 变量会忽略 name_scope
,如果这也适用于 Tensorboard 中的图形组织,我不会感到惊讶。我只使用 variable_scope
来包装任何创建变量的东西,我从来没有遇到过 "unorganized" 变量的这些问题。