glasses.models.utils package

Submodules

glasses.models.utils.scaler module

class glasses.models.utils.scaler.CompoundScaler[source]

Bases: object

Scales widths and depths. Proposed in EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks.

Examples:
>>> scaler = CompoundScaler()
>>> scaler(1.1, 1.2, [32, 64, 128], [2,2,3])
__call__(width_factor: float, depth_factor: float, widths: List[int], depths: List[int]) List[int][source]

Scale up widhts and depths using width_factor and depth_factor

Parameters
  • width_factor (float) – value used to scale up widths

  • depth_factor (float) – value used to scale up depths

  • widths (List[int]) – array where each value is the number of in_features in one layer

  • depths (List[int]) – array where each value is the number of blocks in one layer

Returns

scaled widths and depths

Return type

Union[List[int], List[int]]

depth_scaling(depth: int, depth_multi: float) int[source]
make_divisible(value: float, divisor: int = 8) int[source]
width_scaling(width: int, width_multi: float) int[source]

Module contents