MCPcopy Create free account
hub / github.com/pytorch/pytorch / GetComputedParams

Method GetComputedParams

caffe2/python/model_helper.py:390–403  ·  view source on GitHub ↗

Returns the computed params in current namescope. 'Computed params' are such parameters that are not optimized via gradient descent but are directly computed from data, such as the running mean and variance of Spatial Batch Normalization.

(self, namescope=None)

Source from the content-addressed store, hash-verified

388 assert dupes == [], "Duplicate params: {}".format(dupes)
389
390 def GetComputedParams(self, namescope=None):
391 '''
392 Returns the computed params in current namescope. 'Computed params'
393 are such parameters that are not optimized via gradient descent but are
394 directly computed from data, such as the running mean and variance
395 of Spatial Batch Normalization.
396 '''
397 namescope = ModelHelper._NormalizeNamescope(namescope)
398
399 if namescope == '':
400 return self._computed_params[:]
401 else:
402 return [p for p in self._computed_params
403 if p.GetNameScope().startswith(namescope)]
404
405 def GetAllParams(self, namescope=None):
406 return self.GetParams(namescope) + self.GetComputedParams(namescope)

Callers 8

GetAllParamsMethod · 0.95
test_get_paramsMethod · 0.95
broadcast_parametersFunction · 0.80
save_model_params_blobFunction · 0.80
ParallelizeFunction · 0.80
_ComputeBlobsToSyncFunction · 0.80
GetAllParamsMethod · 0.80

Calls 2

_NormalizeNamescopeMethod · 0.80
GetNameScopeMethod · 0.80

Tested by 2

test_get_paramsMethod · 0.76