tumourkit.segmentation.evaluate.add_matrices

tumourkit.segmentation.evaluate.add_matrices(A: ndarray, B: ndarray) ndarray

Adds two matrices even if their shapes are different. If B is bigger than A, A is enlarged with zeros. And vice versa.

Parameters:
  • A (np.ndarray) – The first matrix.

  • B (np.ndarray) – The second matrix.

Returns:

The sum of the two matrices.

Return type:

np.ndarray