Utils#

This module contains the loss functions used in the project.

Auto Padding#

fusionlab.utils.autopad(kernal_size, padding=None)[source]#

Make N tuple#

fusionlab.utils.make_ntuple(x, n)[source]#

Make n-tuple from input x. If x is an iterable, then we just convert it to tuple. Otherwise, we will make a tuple of length n, all with value of x. reference: pytorch/vision

Parameters:
  • x (Any) – input value

  • n (int) – length of the resulting tuple

Return type:

Tuple[Any, …]

Show Class Tree#

fusionlab.utils.show_classtree(clss, indent=0)[source]#

Plot channels#

fusionlab.utils.plot_channels(signals, show=True)[source]#

plot signals by channels

Parameters:

signals – numpy array, shape (num_samples, num_channels)