0
次のように私は、カスタムの入力機能を持っている:なぜtf.train.batchは機能のバッチを1つだけ返しますか?
def my_input_fn():
# parse a file and create a dictionary of features
return features
この機能はinput_fn
のparamとしてtf.contrib.learn.Estimator.predict
関数に渡されます。私は異なるバッチで自分のデータを渡したい。検索後、それはtf.train.batch
の責任と思われます。だから、次のように私の機能を編集:
def my_input_fn():
# parse a file and create a dictionary of features
return tf.learn.batch(tensors=features, batch_size=100, enqueue_many=True)
問題がpredict(input_fn=my_input_fn)
を呼び出すとバッチのみで100例についての推定結果を返すということです。すべてのデータをバッチで返すようにするには、どのようにしてmy_input_fn
関数を設計できますか?将来の読者のために