def add_all_parameter_histograms(self, last_var, global_step=None, pattern='.*'):
cp = re.compile(pattern)
g = c.build_computational_graph(last_var)
names = NodeName(g.nodes)
for n in g.nodes:
if isinstance(n, chainer.variable.VariableNode) and \
isinstance(n._variable(), chainer.Parameter) and \
cp.match(names.name(n)):
data = chainer.cuda.to_cpu(n._variable().data)
self.add_histogram(names.name(n), data, global_step)
评论列表
文章目录