cellmap_flow.finetune.trainer.tensorboard ========================================= .. py:module:: cellmap_flow.finetune.trainer.tensorboard .. autoapi-nested-parse:: A run's TensorBoard event files: the config card, a patch image strip, and the per-step and per-epoch scalars. File-based, so it works from GPU nodes with no network and needs no service; one ``tensorboard --logdir`` over the training/ tree overlays every run ever made. Silently off if unavailable or not asked for. Attributes ---------- .. autoapisummary:: cellmap_flow.finetune.trainer.tensorboard.logger Classes ------- .. autoapisummary:: cellmap_flow.finetune.trainer.tensorboard.TensorBoard Module Contents --------------- .. py:data:: logger .. py:class:: TensorBoard(log_dir, enabled=True, start_step=0, start_epoch=0) The writer, and the step and epoch it is at. Monotonic across restarts: the CLI makes a new trainer for every iteration, writing to the same tensorboard/ directory, and passes the previous one's position on (``start_step``, ``start_epoch``). Starting each at 0 drew every iteration's curves on top of each other. .. py:attribute:: image_every :value: 5 .. py:attribute:: dir .. py:attribute:: step :value: 0 .. py:attribute:: epoch :value: 0 .. py:attribute:: writer :value: None .. py:property:: on :type: bool .. py:method:: config_card(rows) The run's settings as a table under the "config" text tag. .. py:method:: images(raw, target, pred, mask, channel, output_class) Mid-Z slice of one sample as one strip: raw (centre-cropped to the output) | target | prediction | mask, at the current epoch. This is the picture that would have shown augmentation doing nothing for five months, and that shows raw and labels moving together once it does something. Never lets a display problem stop training. .. py:method:: log_step(*, loss, supervised, distillation, other_channels, bce_metrics, interval_terms, lr, step_s, data_wait_s) One optimizer step's scalars, at the next step; ``distillation`` and ``other_channels`` (the hold on the channels not trained) None when off. .. py:method:: log_epoch(*, loss, supervised, best_supervised, bce_metrics, other_channels, data_wait_s, compute_s, peak_memory_gb) One epoch's scalars, at the next epoch; ``supervised`` None when nothing was supervised, ``other_channels`` (how far the channels not trained moved) None without the hold. .. py:method:: flush() .. py:method:: close() Close the writer; the CLI calls this when an iteration is done.