MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / _round_repeats

Function _round_repeats

monai/networks/nets/efficientnet.py:901–916  ·  view source on GitHub ↗

Re-calculate module's repeat number of a block based on depth coefficient multiplier. Args: repeats: number of original repeats. depth_coefficient: depth coefficient for model. Returns: new repeat: new number of repeat after calculating.

(repeats: int, depth_coefficient: float | None)

Source from the content-addressed store, hash-verified

899
900
901def _round_repeats(repeats: int, depth_coefficient: float | None) -> int:
902 """
903 Re-calculate module's repeat number of a block based on depth coefficient multiplier.
904
905 Args:
906 repeats: number of original repeats.
907 depth_coefficient: depth coefficient for model.
908
909 Returns:
910 new repeat: new number of repeat after calculating.
911 """
912 if not depth_coefficient:
913 return repeats
914
915 # follow the formula transferred from official TensorFlow impl.
916 return int(math.ceil(depth_coefficient * repeats))
917
918
919def _calculate_output_image_size(input_image_size: list[int], stride: int | tuple[int]):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…