(self, multi_gpu=False)
main entrypoint to build model
main entrypoint to build model
main entrypoint to build model
def build(self, multi_gpu=False):
    ''' main entrypoint to build model '''
    assert self.model

    loss = self.get_loss()
    optimizer = self.get_optimizer()

    run_opts, run_metas = self.get_run_opts_metas()

    # compile model
    if self.ngpu > 1 and multi_gpu:
      self._parallel_model = multi_gpu_model(
          self.model, gpus=self.ngpu, cpu_relocation=False, cpu_merge=False)
      self.parallel_model.compile(
          loss=loss,
          optimizer=optimizer,
          metrics=self._metrics_used,
          options=run_opts,
          run_metadata=run_metas)
    else:
      self.model.compile(
          loss=loss,
          optimizer=optimizer,
          metrics=self._metrics_used,
          options=run_opts,
          run_metadata=run_metas)

    # Print model summary
    if self.model.built and self.model._is_graph_network:
      self.model.summary()
    self._built = True
def build ( self , multi_gpu = False ) : assert self . model loss = self . get_loss ( ) optimizer = self . get_optimizer ( ) run_opts , run_metas = self . get_run_opts_metas ( ) # compile model if self . ngpu > 1 and multi_gpu : self . _parallel_model = multi_gpu_model ( self . model , gpus = self . ngpu , cpu_relocation = False , cpu_merge = False ) self . parallel_model . compile ( loss = loss , optimizer = optimizer , metrics = self . _metrics_used , options = run_opts , run_metadata = run_metas ) else : self . model . compile ( loss = loss , optimizer = optimizer , metrics = self . _metrics_used , options = run_opts , run_metadata = run_metas ) # Print model summary if self . model . built and self . model . _is_graph_network : self . model . summary ( ) self . _built = True