| 18 | |
| 19 | |
| 20 | class 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 | |
| 36 | def get_data(subset): |