class_docstr: An AdaNet estimator builder.
class_docstr_tok: ["An","AdaNet","estimator","builder","."]
docstr: Returns an AdaNet `Estimator` for train and evaluation.
  
  Args:
    data_provider: Data `Provider` for dataset to model.
    run_config: `RunConfig` object to configure the runtime settings.
    hparams: `HParams` instance defining custom hyperparameters.
    train_steps: number of train steps.
    seed: An integer seed if determinism is required.
  
  Returns:
    Returns an `Estimator`.
docstr_tok: ["Returns","an","AdaNet","`","Estimator","`","for","train","and","evaluation",".","Args",":","data_provider",":","Data","`","Provider","`","for","dataset","to","model",".","run_config",":","`","RunConfig","`","object","to","configure","the","runtime","settings",".","hparams",":","`","HParams","`","instance","defining","custom","hyperparameters",".","train_steps",":","number","of","train","steps",".","seed",":","An","integer","seed","if","determinism","is","required",".","Returns",":","Returns","an","`","Estimator","`","."]
code: def estimator(
      self,
      data_provider,
      run_config,
      hparams,
      train_steps=None,
      seed=None,
  ):
      """Returns an AdaNet `Estimator` for train and evaluation.
  
      Args:
        data_provider: Data `Provider` for dataset to model.
        run_config: `RunConfig` object to configure the runtime settings.
        hparams: `HParams` instance defining custom hyperparameters.
        train_steps: number of train steps.
        seed: An integer seed if determinism is required.
  
      Returns:
        Returns an `Estimator`.
      """
  
      max_iteration_steps = int(
          train_steps / hparams.boosting_iterations
      )
  
      optimizer_fn = optimizer.fn_with_name(
          hparams.optimizer,
          learning_rate_schedule=hparams.learning_rate_schedule,
          cosine_decay_steps=max_iteration_steps,
      )
      hparams.add_hparam("total_training_steps", max_iteration_steps)
  
      if hparams.generator == GeneratorType.SIMPLE:
          subnetwork_generator = improve_nas.Generator(
              feature_columns=data_provider.get_feature_columns(),
              optimizer_fn=optimizer_fn,
              iteration_steps=max_iteration_steps,
              checkpoint_dir=run_config.model_dir,
              hparams=hparams,
              seed=seed,
          )
      elif hparams.generator == GeneratorType.DYNAMIC:
          subnetwork_generator = improve_nas.DynamicGenerator(
              feature_columns=data_provider.get_feature_columns(),
              optimizer_fn=optimizer_fn,
              iteration_steps=max_iteration_steps,
              checkpoint_dir=run_config.model_dir,
              hparams=hparams,
              seed=seed,
          )
      else:
          raise ValueError(
              "Invalid generator: `%s`" % hparams.generator
          )
  
      evaluator = None
      if hparams.use_evaluator:
          evaluator = adanet.Evaluator(
              input_fn=data_provider.get_input_fn(
                  partition="train",
                  mode=tf.estimator.ModeKeys.EVAL,
                  batch_size=hparams.evaluator_batch_size,
              ),
              steps=hparams.evaluator_steps,
          )
  
      return adanet.Estimator(
          head=data_provider.get_head(),
          subnetwork_generator=subnetwork_generator,
          max_iteration_steps=max_iteration_steps,
          adanet_lambda=hparams.adanet_lambda,
          adanet_beta=hparams.adanet_beta,
          mixture_weight_type=hparams.mixture_weight_type,
          force_grow=hparams.force_grow,
          evaluator=evaluator,
          config=run_config,
          model_dir=run_config.model_dir,
      )
  
file_path: adanet/research/improve_nas/trainer/adanet_improve_nas.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import adanet
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling the Builder obj's underlying member method code with example usage: obj.estimator(data_provider, run_config, hparams, train_steps, seed) and returns: adanet