MCPcopy Create free account
hub / github.com/QWTforGithub/T2LDM / adjust_widths_groups_comp

Function adjust_widths_groups_comp

timm/models/regnet.py:107–113  ·  view source on GitHub ↗

Adjusts the compatibility of widths and groups.

(widths, bottle_ratios, groups)

Source from the content-addressed store, hash-verified

105
106
107def adjust_widths_groups_comp(widths, bottle_ratios, groups):
108 """Adjusts the compatibility of widths and groups."""
109 bottleneck_widths = [int(w * b) for w, b in zip(widths, bottle_ratios)]
110 groups = [min(g, w_bot) for g, w_bot in zip(groups, bottleneck_widths)]
111 bottleneck_widths = [quantize_float(w_bot, g) for w_bot, g in zip(bottleneck_widths, groups)]
112 widths = [int(w_bot / b) for w_bot, b in zip(bottleneck_widths, bottle_ratios)]
113 return widths, groups
114
115
116def generate_regnet(width_slope, width_initial, width_mult, depth, q=8):

Callers 1

_get_stage_paramsMethod · 0.85

Calls 1

quantize_floatFunction · 0.85

Tested by

no test coverage detected