代码之家  ›  专栏  ›  技术社区  ›  Salvador Dali

如何对张力板的可学习参数进行分组?

  •  1
  • Salvador Dali  · 技术社区  · 6 年前

    在tensorflow中,我通常以以下方式构造可学习的参数:

    learnable_weights = {
      'w1': tf.get_variable(...),
      ...
      'wn': tf.get_variable(...),
    } 
    
    learnable_biases = {
      'bc1': tf.get_variable(...),
      ...
      'bd3': tf.get_variable(...)
    }
    

    我最近开始遇到的问题是拥挤的tensorboard图,我在辅助节点中有很多权重(这是一个大图的一部分,这些节点的数量要大得多):

    enter image description here

    tf.name_scope . 像这样:

    with tf.name_scope('learnable_params'):
      learnable_weights = {...}
      learnable_biases = {...}
    

    有什么理由或更好的建议如何分组可学习的参数,使他们不会混乱的张力板?

    1 回复  |  直到 6 年前
        1
  •  2
  •   xdurch0    6 年前

    你可以试着用 variable_scope 而不是 name_scope . AFAIK变量通过 get_variable 名称\u范围 包装任何创建变量的东西,我从来没有遇到过“无组织”变量的问题。