Skip to content

Instantly share code, notes, and snippets.

@chaserileyroberts
Last active October 26, 2017 18:47
Show Gist options
  • Save chaserileyroberts/988ce2340914c76b3886d000dd5ecc03 to your computer and use it in GitHub Desktop.
Save chaserileyroberts/988ce2340914c76b3886d000dd5ecc03 to your computer and use it in GitHub Desktop.
class Model:
def __init__(self, input, labels):
"""Classifier model
Args:
input: Input tensor of size (None, input_dims)
label: Label tensor of size (None, 1).
Should be of type tf.int32.
"""
prediction = self.make_network(input)
# Prediction size is (None, 1).
self.loss = tf.nn.softmax_cross_entropy_with_logits(
logits=prediction, labels=labels)
self.train_op = tf.train.AdamOptimizer().minimize(self.loss)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment