MCPcopy Create free account
hub / github.com/tensorpack/tensorpack / new_get_variable

Method new_get_variable

examples/DoReFa-Net/resnet-dorefa.py:44–51  ·  view source on GitHub ↗
(v)

Source from the content-addressed store, hash-verified

42 fw, fa, fg = get_dorefa(BITW, BITA, BITG)
43
44 def new_get_variable(v):
45 name = v.op.name
46 # don't binarize first and last layer
47 if not name.endswith('W') or 'conv1' in name or 'fct' in name:
48 return v
49 else:
50 logger.info("Binarizing weight {}".format(v.op.name))
51 return fw(v)
52
53 def nonlin(x):
54 return tf.clip_by_value(x, 0.0, 1.0)

Callers

nothing calls this directly

Calls 2

fwFunction · 0.85
formatMethod · 0.80

Tested by

no test coverage detected