MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / add_activation_summary

Function add_activation_summary

tensorpack/tfutils/summary.py:140–158  ·  view source on GitHub ↗

Call :func:`add_tensor_summary` under a reused 'activation-summary' name scope. This function is a no-op if not calling from main training tower. Args: x (tf.Tensor): the tensor to summary. types (list[str]): summary types, defaults to ``['sparsity', 'rms', 'histogram']

(x, types=None, name=None, collections=None)

Source from the content-addressed store, hash-verified

138
139
140def add_activation_summary(x, types=None, name=None, collections=None):
141 """
142 Call :func:`add_tensor_summary` under a reused 'activation-summary' name scope.
143 This function is a no-op if not calling from main training tower.
144
145 Args:
146 x (tf.Tensor): the tensor to summary.
147 types (list[str]): summary types, defaults to ``['sparsity', 'rms', 'histogram']``.
148 name (str): if is None, use x.name.
149 collections (list[str]): collections of the summary ops.
150 """
151 ndim = x.get_shape().ndims
152 if ndim < 2:
153 logger.warn("Cannot summarize scalar activation {}".format(x.name))
154 return
155 if types is None:
156 types = ['sparsity', 'rms', 'histogram']
157 with cached_name_scope('activation-summary'):
158 add_tensor_summary(x, types, name=name, collections=collections)
159
160
161def add_param_summary(*summary_lists, **kwargs):

Callers

nothing calls this directly

Calls 3

cached_name_scopeFunction · 0.85
add_tensor_summaryFunction · 0.85
formatMethod · 0.80

Tested by

no test coverage detected