cuvis_ai.deciders.multiclass_decider.MultiClassDecider

class cuvis_ai.deciders.multiclass_decider.MultiClassDecider(n: int, use_min: bool = False)[source]

Bases: BaseDecider

Simple multi-class maximum decider. Given a matrix with N channels, chooses the channel with the highest value per spatial location. The result will be a single channel matrix with the indices of the chosen channels as values.

__init__(n: int, use_min: bool = False) None[source]

Create multi-class decider instance

Parameters:
  • n (int) – Number of classes

  • use_min (bool) – Use the minimizing value to decide

Methods

__init__(n[, use_min])

Create multi-class decider instance

check_input_dim(X)

Check that the parameters for the input data data match user expectations

check_output_dim(X)

Check that the parameters for the output data data match user expectations

fit(X)

forward(X)

Apply the maximum classification on the data.

get_fit_requested_meta()

get_forward_requested_meta()

load(params, filepath)

Load this node from a serialized graph.

serialize(directory)

Convert the class into a serialized representation

set_fit_meta_request(**kwargs)

set_forward_meta_request(**kwargs)

Attributes

input_dim

Returns the needed shape for the input data.

output_dim

Returns the provided shape for the output data.

check_input_dim(X)

Check that the parameters for the input data data match user expectations

Parameters: X (array-like): Input data.

Returns: (Bool) Valid data

check_output_dim(X)

Check that the parameters for the output data data match user expectations

Parameters: X (array-like): Input data.

Returns: (Bool) Valid data

fit(X)
forward(X: ndarray) ndarray[source]

Apply the maximum classification on the data. :param X: Data to apply the classification on. :type X: np.ndarray

Returns:

Classified data. Single channel matrix comprised of the channel indices of the chosen classes.

Return type:

np.ndarray

get_fit_requested_meta()
get_forward_requested_meta()
property input_dim

Returns the needed shape for the input data. If a dimension is not important, it will return -1 in the specific position.

Returns: (tuple) needed shape for data

load(params: dict, filepath: str)[source]

Load this node from a serialized graph.

property output_dim

Returns the provided shape for the output data. If a dimension is not important it will return -1 in the specific position.

Returns:

Provided shape for data

Return type:

tuple

serialize(directory: str)[source]

Convert the class into a serialized representation

set_fit_meta_request(**kwargs)
set_forward_meta_request(**kwargs)