Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is fraction_of_32_full in TensorFlow

String Input Producer contains a fraction of 32 full.

As can be seen in this picture, my graph has a: "fraction_of_32_full" output attached to it. I haven't done this explicitly, and nowhere in my code have I set any limits of a size of 32.

The only data I am explicitly adding to my summary is the cost of each batch, yet when I view my TensorBoard visualisation, I see this:

Tensorboard Visualisation

As you can see, it contains three things. The cost, which I asked for, and two other variables which I havent asked for. The fraction of 25,000 full, and the fraction of 32 full.

My Questions Are:

  1. What are these?
  2. Why are they added to my summaries without me explicitly asking?
like image 310
John Scolaro Avatar asked Dec 19 '22 06:12

John Scolaro


1 Answers

I can actually answer my own question here. I did some digging, and found the answers.

  1. What are these?

These are measures of how full your queues are. I have two queues, a string input producer queue which reads my files, and a batch queue which batches my records. Both of the records are in the format: "fraction of x full" where x is the capacity of the queue.

The reason the string input producer is fraction of 32, is because if you look at the documentation here, you'll see the default capacity is 32.

  1. Why are these added to my summaries without me explicitly asking.

This was a little trickier. If you look at the source code for the input string producer here, you'll see that although the input_string_producer doesn't explicitly ask for a summary name, it returns an input_producer, which has a default summary name of: summary_name="fraction_of_%d_full" % capacity. Check line 235 for this. Something similar happens here for the batch queue.

The reason these are being recorded without explicitly asking, is because they were created without explicitly asking, and then the line of code:

merged_summaries = tf.summary.merge_all()

merged all these summaries together, so when I called:

sess.run([optimizer, cost, merged_summaries], ..... )
writer.add_summary(s, batch)

I was actually asking for these to be recorded too.

I hope this answer helped some people.

like image 84
John Scolaro Avatar answered Jan 24 '23 14:01

John Scolaro