def test_colorization(self): imgs_l, imgs_true_ab, imgs_emb = self._tensors() # Build the network and the optimizer step col = Colorization(256) imgs_ab = col.build(imgs_l, imgs_emb) opt_operations = color_optimizer(imgs_ab, imgs_true_ab) self._run(imgs_l, imgs_ab, imgs_true_ab, opt_operations)
def test_colorization(self): imgs_l, imgs_true_ab, imgs_emb = self._tensors() # Build the network and the optimizer step col = Colorization(256) imgs_ab = col.build(imgs_l, imgs_emb) cost = tf.reduce_mean(tf.squared_difference(imgs_ab, imgs_true_ab)) optimizer = tf.train.AdamOptimizer(0.001).minimize(cost) opt_operations = {'cost': cost, 'optimizer': optimizer} self._run(imgs_l, imgs_ab, imgs_true_ab, opt_operations)