From 6f0568f609c938019eabffbdcdd411d8735d2cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20Poulain--Auz=C3=A9au?= <47986600+louisPoulain@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:46:57 +0100 Subject: [PATCH] Move to another script to avoid circular import --- mlpp_lib/utils.py | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/mlpp_lib/utils.py b/mlpp_lib/utils.py index 50a8049..5a21cc8 100644 --- a/mlpp_lib/utils.py +++ b/mlpp_lib/utils.py @@ -43,33 +43,6 @@ def get_callback(callback: Union[str, dict]) -> Callable: return callback -def get_probabilistic_layer( - output_size, - probabilistic_layer: Union[str, dict] -) -> Callable: - """Get the probabilistic layer.""" - - if isinstance(probabilistic_layer, dict): - probabilistic_layer_name = list(probabilistic_layer.keys())[0] - probabilistic_layer_options = probabilistic_layer[probabilistic_layer_name] - else: - probabilistic_layer_name = metric - probabilistic_layer_options = {} - - if hasattr(probabilistic_layers, probabilistic_layer_name): - LOGGER.info(f"Using custom probabilistic layer: {probabiistic_layer_name}") - probabilistic_layer_obj = getattr(probabilistic_layers, probabilistic_layer_name) - probabilistic_layer = ( - probabilistic_layer_obj(output_size, name="output", **probabilistic_layer_options) if isinstance(probabilistic_layer_obj, type) - else probabilistic_layer_obj(output_size, name="output") - ) - else: - raise KeyError(f"The probabilistic layer {probabilistic_layer_name} is not available.") - - return probabilistic_layer - - - def get_model( input_shape: tuple[int], output_shape: Union[int, tuple[int]],