pusion.core.neural_network_combiner

class pusion.core.neural_network_combiner.NeuralNetworkCombiner

Bases: pusion.core.combiner.TrainableCombiner

The NeuralNetworkCombiner (NN) is a learning and classifier-based combiner that converts multiple decision outputs into new features, which in turn are used to train this combiner. The NN includes three hidden layers and a dynamic number of neurons per layer, which is given by (n_classifiers * n_classes).

train(decision_tensor, true_assignments)

Train the NN combiner by fitting the Neural Network model with given decision outputs and true class assignments. Both continuous and crisp classification outputs are supported. This procedure transforms decision outputs into a new feature space.

Parameters
  • decision_tensornumpy.array of shape (n_classifiers, n_samples, n_classes). Tensor of either crisp or continuous decision outputs by different classifiers per sample.

  • true_assignmentsnumpy.array of shape (n_samples, n_classes). Matrix of either crisp or continuous class assignments which are considered true for each sample during the training procedure.

combine(decision_tensor)

Combine decision outputs by the trained Neural Network model. Both continuous and crisp classification outputs are supported. Combining requires a trained NeuralNetworkCombiner. This procedure transforms decision outputs into a new feature space.

Parameters

decision_tensornumpy.array of shape (n_classifiers, n_samples, n_classes). Tensor of either crisp or continuous decision outputs by different classifiers per sample.

Returns

A matrix (numpy.array) of either crisp or continuous class assignments which represents fused decisions obtained by NN. Axis 0 represents samples and axis 1 the class assignments which are aligned with axis 2 in decision_tensor input tensor.

class pusion.core.neural_network_combiner.CRNeuralNetworkCombiner

Bases: pusion.core.neural_network_combiner.NeuralNetworkCombiner

The CRNeuralNetworkCombiner is a modification of NeuralNetworkCombiner that also supports complementary-redundant decision outputs. Therefore the input is transformed, such that all missing classification assignments are considered as a constant, respectively. To use methods train() and combine() a coverage needs to be set first by the inherited set_coverage() method.

train(decision_outputs, true_assignments)

Train the NN combiner by fitting the Neural Network model with given decision outputs and true class assignments. Both continuous and crisp classification outputs are supported. This procedure transforms decision outputs into a new feature space.

Parameters
  • decision_outputslist of numpy.array matrices, each of shape (n_samples, n_classes’), where n_classes’ is classifier-specific and described by the coverage. Each matrix corresponds to one of n_classifiers classifiers and contains either crisp or continuous decision outputs per sample.

  • true_assignmentsnumpy.array of shape (n_samples, n_classes). Matrix of either crisp or continuous class assignments which are considered true for each sample during the training procedure.

combine(decision_outputs)

Combine decision outputs by the trained Neural Network model. Both continuous and crisp classification outputs are supported. Combining requires a trained NeuralNetworkCombiner. This procedure transforms decision outputs into a new feature space.

Parameters

decision_outputslist of numpy.array matrices, each of shape (n_samples, n_classes’), where n_classes’ is classifier-specific and described by the coverage. Each matrix corresponds to one of n_classifiers classifiers and contains crisp or continuous decision outputs per sample.

Returns

A matrix (numpy.array) of either crisp or continuous class assignments which represents fused decisions obtained by NN. Axis 0 represents samples and axis 1 the class assignments which are aligned with axis 2 in decision_tensor input tensor.