Last active
March 6, 2018 16:02
-
-
Save eisenjulian/a94c969ef5274979c9ddc4feb8c244ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
head = tf.contrib.estimator.binary_classification_head() | |
optimizer = tf.train.AdamOptimizer() | |
def _train_op_fn(loss): | |
tf.summary.scalar('loss', loss) | |
return optimizer.minimize( | |
loss=loss, | |
global_step=tf.train.get_global_step()) | |
return head.create_estimator_spec( | |
features=features, | |
labels=labels, | |
mode=mode, | |
logits=logits, | |
train_op_fn=_train_op_fn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment