pugh_torch.callbacks package

Submodules

pugh_torch.callbacks.histogram module

class pugh_torch.callbacks.histogram.Histogram(*, slash_names=True, names=[], **kwargs)[source]

Bases: pugh_torch.callbacks.tensorboard_base.TensorBoardCallback

Relies on model being stored at pl_module.model and it being sequential

Parameters
  • slash_names (bool) – For each named parameter, replace “.” with “/” so that they appear under sublabels in TensorBoard.

  • names (list of str) – The “dot” named parameters to log. Defaults to all model named parameters.

on_train_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx)[source]

Just some validation checks.

pugh_torch.callbacks.model_checkpoint module

class pugh_torch.callbacks.model_checkpoint.ModelCheckpoint(filepath: Optional[str] = None, monitor: Optional[str] = None, verbose: bool = False, save_last: Optional[bool] = None, save_top_k: Optional[int] = None, save_weights_only: bool = False, mode: str = 'auto', period: int = 1, prefix: str = '', dirpath: Union[str, pathlib.Path, None] = None, filename: Optional[str] = None)[source]

Bases: pytorch_lightning.callbacks.model_checkpoint.ModelCheckpoint

pugh_torch.callbacks.tensorboard_add_classification module

class pugh_torch.callbacks.tensorboard_add_classification.TensorBoardAddClassification(*, classes=None, **kwargs)[source]

Bases: pugh_torch.callbacks.tensorboard_base.TensorBoardCallback

Adds the rgb, ground truth label, and the network prediction to tensorboard.

Relies on the attribute last_logits.

Parameters

classes (list) – If provided, the predictions will contain the appropriate annotation. len(classes)` should equal the number of networ output channels. If this is available under trainer.

on_train_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx)[source]

Just some validation checks.

on_train_start(trainer, pl_module)[source]

Called when the train begins.

pugh_torch.callbacks.tensorboard_add_depth module

class pugh_torch.callbacks.tensorboard_add_depth.TensorBoardAddDepth(*, logging_batch_interval=20, **kwargs)[source]

Bases: pugh_torch.callbacks.tensorboard_base.TensorBoardCallback

Adds the rgb, ground truth depth, and the network prediction to tensorboard.

Assumes the network’s prediction is in attribute last_logits with shape (b, h, w).

Parameters
  • logging_batch_interval (int) – Log image(s) every this many batches.

  • kwargs (dict) – Passed along to SummaryWriter method on hook

on_train_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx)[source]

Just some validation checks.

pugh_torch.callbacks.tensorboard_add_ss module

class pugh_torch.callbacks.tensorboard_add_ss.TensorBoardAddSS(*, logging_batch_interval=20, **kwargs)[source]

Bases: pugh_torch.callbacks.tensorboard_base.TensorBoardCallback

Adds the rgb, ground truth segmentation, and the network prediction to tensorboard.

Parameters
  • logging_batch_interval (int) – Log image(s) every this many batches.

  • kwargs (dict) – Passed along to SummaryWriter method on hook

on_train_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx)[source]

Just some validation checks.

pugh_torch.callbacks.tensorboard_base module

class pugh_torch.callbacks.tensorboard_base.TensorBoardCallback(*, logging_batch_interval=20, **kwargs)[source]

Bases: pytorch_lightning.callbacks.base.Callback

Base class for pytorch-lightning callbacks.

Can only be used with pugh_torch.utils.TensorBoardLogger

Parameters
  • logging_batch_interval (int) – Log image(s) every this many batches.

  • kwargs (dict) – Passed along to SummaryWriter method on hook

on_train_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx)[source]

Just some validation checks.

Module contents