def build_model(config): model_name = config.model model_class = registry.get_model_class(model_name) if model_class is None: registry.get("writer").write("No model registered for name: %s" % model_name) model = model_class(config) if hasattr(model, "build"): model.build() model.init_losses_and_metrics() return model
def update_model_args(self): args = sys.argv model_name = None for index, item in enumerate(args): if item == "--model": model_name = args[index + 1] if model_name is None: return model_class = registry.get_model_class(model_name) if model_class is None: return model_class.init_args(self.parser)