mipcandy.data.convertion#

Module Contents#

Functions#

convert_ids_to_logits

param ids:

class ids (…, 1, …)

param num_classes:

number of classes

param channel_dim:

the index of the channel dimension

return:

logits (…, num_classes, …)

convert_logits_to_ids

param logits:

logits (…, num_classes, …)

param channel_dim:

the index of the channel dimension

return:

class ids (…, 1, …)

auto_convert

API#

mipcandy.data.convertion.convert_ids_to_logits(ids: torch.Tensor, num_classes: int, *, channel_dim: int = 1) torch.Tensor[source]#
Parameters:
  • ids – class ids (…, 1, …)

  • num_classes – number of classes

  • channel_dim – the index of the channel dimension

Returns:

logits (…, num_classes, …)

mipcandy.data.convertion.convert_logits_to_ids(logits: torch.Tensor, *, channel_dim: int = 1) torch.Tensor[source]#
Parameters:
  • logits – logits (…, num_classes, …)

  • channel_dim – the index of the channel dimension

Returns:

class ids (…, 1, …)

mipcandy.data.convertion.auto_convert(image: torch.Tensor) torch.Tensor[source]#