Beispiel #1
0
 def build(self, config):
     from zoo.automl.model.base_pytorch_model import PytorchBaseModel
     model = PytorchBaseModel(self.model_creator,
                              self.optimizer_creator,
                              self.loss_creator)
     model.build(config)
     return model
    def build(self, config):
        if self.backend == "pytorch":
            from zoo.automl.model.base_pytorch_model import PytorchBaseModel
            model = PytorchBaseModel(**self.params)
            model.build(config)
            return model

        elif self.backend == "keras":
            from zoo.automl.model.base_keras_model import KerasBaseModel
            model = KerasBaseModel(**self.params)
            model.build(config)
            return model

        elif self.cls is not None:
            return self.cls(config=config)

        else:
            builder = self.from_name(config["model"],
                                     dev_option=config["dev_option"])
            return builder.cls(config=config)