Skip to content

fl_server_ai.uncertainty.none

Classes:

Name Description
NoneUncertainty

Empty uncertainty estimation when no specific uncertainty method is used.

Classes

NoneUncertainty

Bases: UncertaintyBase


              flowchart TD
              fl_server_ai.uncertainty.none.NoneUncertainty[NoneUncertainty]
              fl_server_ai.uncertainty.base.UncertaintyBase[UncertaintyBase]

                              fl_server_ai.uncertainty.base.UncertaintyBase --> fl_server_ai.uncertainty.none.NoneUncertainty
                


              click fl_server_ai.uncertainty.none.NoneUncertainty href "" "fl_server_ai.uncertainty.none.NoneUncertainty"
              click fl_server_ai.uncertainty.base.UncertaintyBase href "" "fl_server_ai.uncertainty.base.UncertaintyBase"
            

Empty uncertainty estimation when no specific uncertainty method is used.

This class does not calculate any uncertainty and only returns the prediction with an empty uncertainty dictionary.

Methods:

Name Description
prediction
Source code in fl_server_ai/uncertainty/none.py
class NoneUncertainty(UncertaintyBase):
    """
    Empty uncertainty estimation when no specific uncertainty method is used.

    This class does not calculate any uncertainty and only returns the prediction with an empty uncertainty dictionary.
    """

    @classmethod
    def prediction(cls, input: torch.Tensor, model: Model) -> Tuple[torch.Tensor, Dict[str, Any]]:
        net: torch.nn.Module = model.get_torch_model()
        prediction: torch.Tensor = net(input)
        return prediction.argmax(dim=1), {}

Functions

prediction classmethod
prediction(input: Tensor, model: Model) -> tuple[Tensor, dict[str, Any]]
Source code in fl_server_ai/uncertainty/none.py
@classmethod
def prediction(cls, input: torch.Tensor, model: Model) -> Tuple[torch.Tensor, Dict[str, Any]]:
    net: torch.nn.Module = model.get_torch_model()
    prediction: torch.Tensor = net(input)
    return prediction.argmax(dim=1), {}