本文整理匯總了Python中graphs.VatxtBidirModel方法的典型用法代碼示例。如果您正苦於以下問題:Python graphs.VatxtBidirModel方法的具體用法?Python graphs.VatxtBidirModel怎麽用?Python graphs.VatxtBidirModel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類graphs
的用法示例。
在下文中一共展示了graphs.VatxtBidirModel方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testBidirLM
# 需要導入模塊: import graphs [as 別名]
# 或者: from graphs import VatxtBidirModel [as 別名]
def testBidirLM(self):
graphs.VatxtBidirModel().language_model_graph()
示例2: testBidirClassifier
# 需要導入模塊: import graphs [as 別名]
# 或者: from graphs import VatxtBidirModel [as 別名]
def testBidirClassifier(self):
at_methods = [None, 'rp', 'at', 'vat', 'atvat']
for method in at_methods:
FLAGS.adv_training_method = method
with tf.Graph().as_default():
graphs.VatxtBidirModel().classifier_graph()
# Ensure variables have been reused
# Embedding + 2 LSTM layers + hidden layers + logits layer
expected_num_vars = 1 + 2 * 2 * FLAGS.rnn_num_layers + 2 * (
FLAGS.cl_num_layers) + 2
self.assertEqual(len(tf.trainable_variables()), expected_num_vars)
示例3: testBidirEvalGraph
# 需要導入模塊: import graphs [as 別名]
# 或者: from graphs import VatxtBidirModel [as 別名]
def testBidirEvalGraph(self):
_, _ = graphs.VatxtBidirModel().eval_graph()