Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
anantzoid committed Nov 19, 2016
1 parent e4c72ec commit e56e36c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ def train(conf, data):
conf.img_height, conf.img_width, conf.channel]))
batch_y = one_hot(batch_y, conf.num_classes)
else:
pointer = 0
batch_X, pointer = get_batch(data, pointer, conf.batch_size)
#batch_X, batch_y = next(data)
data_dict = {X:batch_X}
if conf.conditional is True:
#TODO extract one-hot classes
data_dict[model.h] = batch_y
_, cost,_f = sess.run([optimizer, model.loss, model.fc2], feed_dict=data_dict)
print _f[0]
print "Epoch: %d, Cost: %f"%(i, cost)

saver.save(sess, conf.ckpt_file)
Expand Down
4 changes: 2 additions & 2 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ def __init__(self, X, conf, h=None):

self.loss = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(self.fc2, tf.cast(tf.reshape(self.X, [-1]), dtype=tf.int32)))

#self.pred = tf.reshape(tf.argmax(tf.nn.softmax(self.fc2), dimension=tf.rank(self.fc2) - 1), tf.shape(self.X))
self.pred = tf.reshape(tf.multinomial(tf.nn.softmax(self.fc2), num_samples=1, seed=100), tf.shape(self.X))
self.pred_argmax = tf.reshape(tf.argmax(tf.nn.softmax(self.fc2), dimension=tf.rank(self.fc2) - 1), tf.shape(self.X))
self.pred_sample = tf.reshape(tf.multinomial(tf.nn.softmax(self.fc2), num_samples=1, seed=100), tf.shape(self.X))

0 comments on commit e56e36c

Please sign in to comment.