GUI for monitoring training progress interactively.

class sleap.nn.monitor.LossViewer(zmq_context: Optional[zmq.sugar.context.Context] = None, show_controller=True, parent=None)[source]

Qt window for showing in-progress training metrics sent over ZMQ.

add_datapoint(x, y, which='batch')[source]

Adds data point to graph.

  • x – typically the batch number (out of all epochs, not just current)

  • y – typically the loss value

  • which – type of data point we’re adding, possible values are * batch (loss for batch) * epoch_loss (loss for entire epoch) * val_loss (validation loss for for epoch)

check_messages(timeout=10, times_to_check: int = 10, do_update: bool = True)[source]

Polls for ZMQ messages and adds any received data to graph.

The message is a dictionary encoded as JSON:
  • event - options include
    • train_begin

    • train_end

    • epoch_begin

    • epoch_end

    • batch_end

  • what - this should match the type of model we’re training and

    ensures that we ignore old messages when we start monitoring a new training session (when we’re training multiple types of models in a sequence, as for the top-down pipeline).

  • logs - dictionary with data relevant for plotting, can include
    • loss

    • val_loss

close(self) → bool[source]

Action to stop training.