Hi,
Iโd like to use the stream API to update a graph with the loss and accuracy metrics from a neural network. Iโm using the Keras library to write the network, which has a callbacks function. I can use on_train_begin
, on_train_end
, on_batch_begin
, on_batch_end
, on_epoch_begin
and on_epoch_end
methods to make the various stream.open()
etc. calls.
The fundamental problem Iโm experiencing right now, however, is that often an individual epoch takes longer than 60s, so plotly closes the stream. Upon reopening it, the data is lost and I often end up with an empty graph at the end.
Iโm not sure how to do a stream.heartbeat()
call because none of the methods available to me in the callback
run with a predictable enough frequency (much less a frequency that would be <30s).
As a workaround, Iโm currently just adding new data using the fileopts='extend'
argument in py.plot()
. While this achieves the goal of streaming data to a graph, it isnโt updated in realtime - that is, I have to refresh the page to see the new points.
After all that preamble, is there a way to achieve 1) Constantly updated data sent to plotly, and 2) a graph that updates in realtime?
Thanks for your help in advance!