Exemple #1
0
def nonstatic(features, labels, mode, params):
    with tf.device('/cpu:0'):
        word_vecs = embed.nonstatic(features)
    with tf.device('/gpu:0'):
        normed_word_vecs = normalize(word_vecs, mode)
        rnn = convolution(normed_word_vecs, features['INPUTLEN'], mode)
        fully_connected = dense(rnn, mode)
        outputs = output.output(fully_connected)
        return output.train_or_predict(features, labels, mode, params, outputs)
Exemple #2
0
def nonstatic(features, labels, mode, params):
    with tf.device('/gpu:{}'.format(hypers.get_param('sg'))):
        word_vecs = embed.nonstatic(features)
    with tf.device('/gpu:{}'.format(hypers.get_param('sg'))):
        normed_word_vecs = normalize(word_vecs, mode)
        rnn = recurrent(normed_word_vecs, features['INPUTLEN'], mode)
        fully_connected = dense(rnn, mode)
        outputs = output.output(fully_connected)
        return output.train_or_predict(features, labels, mode, params, outputs)