visualizer.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:deepmodels 作者: learningsociety 项目源码 文件源码
def vis_filter_activations(output_name, output_tensor):
  """Add filter activation to image summary.

  Args:
    output_name: name of the output layer.
    output_tensor: tensor of the output layer. It should have 4D shape.
  """
  # split into chunks of 3.
  tf.assert_equal(len(output_tensor.get_shape()), 4)
  num_splits = output_tensor.get_shape()[0] / 3
  acti_grids = tf.split(0, num_splits, output_tensor,
                        "{} split".format(output_name))
  for split_id in range(num_splits):
    summary_name = "{} split {}".format(output_name, split_id)
    tf.summary.image(summary_name, acti_grids[split_id], 3)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号