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

Class Model

examples/boilerplate.py:20–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19
20class Model(ModelDesc):
21 def inputs(self):
22 return [tf.TensorSpec((None, SHAPE, SHAPE, CHANNELS), tf.float32, 'input1'),
23 tf.TensorSpec((None,), tf.int32, 'input2')]
24
25 def build_graph(self, input1, input2):
26
27 cost = tf.identity(input1 - input2, name='total_costs')
28 summary.add_moving_summary(cost)
29 return cost
30
31 def optimizer(self):
32 lr = tf.get_variable('learning_rate', initializer=5e-3, trainable=False)
33 return tf.train.AdamOptimizer(lr)
34
35
36def get_data(subset):

Callers 1

get_configFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected