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

Function is_training_name

tensorpack/tfutils/varmanip.py:267–291  ·  view source on GitHub ↗

**Guess** if this variable is only used in training. Only used internally to avoid too many logging. Do not use it.

(name)

Source from the content-addressed store, hash-verified

265
266
267def is_training_name(name):
268 """
269 **Guess** if this variable is only used in training.
270 Only used internally to avoid too many logging. Do not use it.
271 """
272 # TODO: maybe simply check against TRAINABLE_VARIABLES and MODEL_VARIABLES?
273 # TODO or use get_slot_names()
274 name = get_op_tensor_name(name)[0]
275 if name.endswith('/Adam') or name.endswith('/Adam_1'):
276 return True
277 if name.endswith('/Momentum'):
278 return True
279 if name.endswith('/Adadelta') or name.endswith('/Adadelta_1'):
280 return True
281 if name.endswith('/RMSProp') or name.endswith('/RMSProp_1'):
282 return True
283 if name.endswith('/Adagrad'):
284 return True
285 if name.startswith('EMA/') or '/EMA/' in name: # all the moving average summaries
286 return True
287 if name.startswith('AccumGrad') or name.endswith('/AccumGrad'):
288 return True
289 if name.startswith('apply_gradients'):
290 return True
291 return False
292
293
294load_chkpt_vars = load_checkpoint_vars

Callers 2

_match_varsMethod · 0.85
_run_initMethod · 0.85

Calls 1

get_op_tensor_nameFunction · 0.85

Tested by

no test coverage detected