MCPcopy Create free account
hub / github.com/EryiXie/PlaneRecNet / construct_backbone

Function construct_backbone

models/backbone.py:233–243  ·  view source on GitHub ↗

Constructs a backbone given a backbone config object (see config.py).

(cfg)

Source from the content-addressed store, hash-verified

231
232
233def construct_backbone(cfg):
234 """ Constructs a backbone given a backbone config object (see config.py). """
235 backbone = cfg.type(*cfg.args)
236
237 # Add downsampling layers until we reach the number we need
238 num_layers = max(cfg.selected_layers) + 1
239
240 while len(backbone.layers) < num_layers:
241 backbone.add_layer()
242
243 return backbone

Callers 1

__init__Method · 0.90

Calls 1

add_layerMethod · 0.80

Tested by

no test coverage detected