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
optimizer = tf.train.AdamOptimizer(learning_rate) | |
with tf.name_scope("phase1"): | |
phase1_outputs = tf.matmul(hidden1, weights4) + biases4 # bypass hidden2 and hidden3 | |
phase1_reconstruction_loss = tf.reduce_mean(tf.square(phase1_outputs - X)) | |
phase1_reg_loss = regularizer(weights1) + regularizer(weights4) | |
phase1_loss = phase1_reconstruction_loss + phase1_reg_loss | |
phase1_training_op = optimizer.minimize(phase1_loss) | |
with tf.name_scope("phase2"): |
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
training_phrases = { | |
'when_is_open' : ' '.join([ | |
'when is the restaurant open?', | |
'when to start open?' | |
]), | |
'where_is_the_restaurant' : ' '.join([ | |
'where is the restaurant', | |
'what is the location of the restaurant?', |
OlderNewer