Tensorflow入力キューに関して完全に理解できないことについて質問したいと思います。私はTensorflowモジュールを作成しました。このモジュールは、以下のようにデータバッチを作成します。Tensorflowオートコードコードの明確化とカスタムテストデータ
このコード:
# various initialization variables
BATCH_SIZE = 128
N_FEATURES = 9
def batch_generator(filenames, record_bytes):
""" filenames is the list of files you want to read from.
In this case, it contains only heart.csv
"""
record_bytes = 29**2 # 29x29 images per record
filename_queue = tf.train.string_input_producer(filenames)
reader = tf.FixedLengthRecordReader(record_bytes=record_bytes) # skip the first line in the file
_, value = reader.read(filename_queue)
print(value)
# read in the 10 columns of data
content = tf.decode_raw(value, out_type=tf.uint8)
# The bytes read represent the image, which we reshape
# from [depth * height * width] to [depth, height, width].
depth_major = tf.reshape(
tf.strided_slice(content, [0],
[record_bytes]),
[1, 29, 29])
# Convert from [depth, height, width] to [height, width, depth].
uint8image = tf.transpose(depth_major, [1, 2, 0])
uint8image = tf.reshape(uint8image, [29**2]) # reshape it a single- dimensional vector
uint8image = tf.cast(uint8image, tf.float32)
uint8image = tf.nn.l2_normalize(uint8image,dim=0) # normalize along vertical dimension
# minimum number elements in the queue after a dequeue, used to ensure
# that the samples are sufficiently mixed
# I think 10 times the BATCH_SIZE is sufficient
min_after_dequeue = 10 * BATCH_SIZE
# the maximum number of elements in the queue
capacity = 20 * BATCH_SIZE
# shuffle the data to generate BATCH_SIZE sample pairs
data_batch = tf.train.shuffle_batch([uint8image], batch_size=BATCH_SIZE,
capacity=capacity, min_after_dequeue=min_after_dequeue)
return data_batch
私の質問は、私は正確に128私はこの関数を呼び出すたびに記録し得るのですか?など
batch_xs = sess.run(data_batch)
1)ここでは、batch_xsの値はどのような値になりますか?
2)私が使用した例では、トレーニングの効率を評価するために、次のコードを使用:
encode_decode = sess.run(
y_pred, feed_dict={X: mnist.test.images[:examples_to_show]})
どのように私は別のバイナリに保存されてきた私自身のテストデータを供給しに行きますかファイル?この質問は私の前の投稿に関連しています。Tensorflow Autoencoder with custom training examples from binary fileです。