MCPcopy
hub / github.com/facebookresearch/mmf / build_model

Function build_model

pythia/utils/build_utils.py:38–51  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

36
37
38def build_model(config):
39 model_name = config.model
40
41 model_class = registry.get_model_class(model_name)
42
43 if model_class is None:
44 registry.get("writer").write("No model registered for name: %s" % model_name)
45 model = model_class(config)
46
47 if hasattr(model, "build"):
48 model.build()
49 model.init_losses_and_metrics()
50
51 return model
52
53
54def build_optimizer(model, config):

Callers 1

load_modelMethod · 0.90

Calls 5

get_model_classMethod · 0.80
writeMethod · 0.80
getMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected