Early stopping with tflearn
<p>I'm having a hard time to figure out how to implement early stopping with tflearn. Supposedly it works by using callbacks in the model.fit() function but I don't quite get how it's done...
This is the example on the website but it still needs a Monitor class that I can't get to work:</p>

<pre><code>class MonitorCallback(tflearn.callbacks.Callback):
    def __init__(self, api):
        self.my_monitor_api = api

    def on_epoch_end(self, training_state):
        self.my_monitor_api.send({
            accuracy: training_state.global_acc,
            loss: training_state.global_loss,
        })

monitorCallback = new MonitorCallback(api) 
model = ...

model.fit(..., callbacks=monitorCallback)
</code></pre>

<p>Does anyone have an example or an idea of how to do this? Cheers</p>

<p>Which version of tflearn are you using? Most probably you will need to download the repo to leverage the feature right now. <a href="https://github.com/tflearn/tflearn/pull/288" rel="nofollow">Early commits for the feature are dated on Aug 17 2016</a> but latest release (<a href="https://github.com/tflearn/tflearn/commit/8b4ac4d14cecfc6695e3d10927f4394a4696ab08" rel="nofollow">v2.2.0</a> when writing this) is dated Aug 10 2016 and does not include it. Perhaps that explains the issue ...</p>

python machine-learning tensorflow