Accessing Variable in Keras Callback
<p>So I've a CNN implemented. I have made custom callbacks that are confirmed working but I have an issue.</p>

<p>This is a sample output.
Example of iteration 5 (batch-size of 10,000 for simplicity)</p>

<pre><code>50000/60000 [========================&gt;.....] - ETA: 10s ('new lr:', 0.01)

('accuracy:', 0.70)
</code></pre>

<p>I have 2 callbacks (tested to work as shown in the output):
(1) Changes the learning rate at each iteration. (2) Prints the accuracy at each iteration.</p>

<p>I have an external script that determines the learning rate by taking in the accuracy. </p>

<p><strong>Question:</strong>
How to make the accuracy at each iteration available so that an external script can access it? In essence an accessible variable at each iteration. I'm able to access it only once the process is over with <code>AccuracyCallback.accuracy</code></p>

<p><strong>Problem</strong>
I can pass a changing learning rate. But how do I get the accuracy once this has been passed in a form of an accessible variable at each iteration?</p>

<p><strong>Example</strong>
My external script determines the learning rate at iteration 1: 0.01. How do I get the accuracy as an accessible variable in my external script at iteration 1 instead of a print statement?</p>