class_docstr: Abstract base class for transfer learning hooks.
  
  This hook initializes the model's variables with values from previously
  completed trials. Subclasses are responsible for determining how to combine
  matching variables from previous trials. If any variable of a particular
  previous trial does not match in name, shape, or dtype to corresponding
  variable of the current trial it will be ignored.
class_docstr_tok: ["Abstract","base","class","for","transfer","learning","hooks",".","This","hook","initializes","the","model","'s","variables","with","values","from","previously","completed","trials",".","Subclasses","are","responsible","for","determining","how","to","combine","matching","variables","from","previous","trials",".","If","any","variable","of","a","particular","previous","trial","does","not","match","in","name",",","shape",",","or","dtype","to","corresponding","variable","of","the","current","trial","it","will","be","ignored","."]
docstr: Initializes a new BaseTransferLearningHoook instance.
  
  Args:
    vars_to_warm_start: The variables to warm start from previous trials.
    current_trial_id: The id of the current trial.
    completed_trials: The list of successfully completed trials. Will be used
      to warm start the variables of the current trial.
    discount_factor: Determines the importance of variables from past trials.
      If the current trial is n, the variables W of trial k, where k < n, will
      be weighted as W * discount_factor^(n-k).
    max_completed_trials: The maximum number of completed trials to consider
      when warm starting the current trial variables.
    model_dir: The current model directory (string).
docstr_tok: ["Initializes","a","new","BaseTransferLearningHoook","instance",".","Args",":","vars_to_warm_start",":","The","variables","to","warm","start","from","previous","trials",".","current_trial_id",":","The","id","of","the","current","trial",".","completed_trials",":","The","list","of","successfully","completed","trials",".","Will","be","used","to","warm","start","the","variables","of","the","current","trial",".","discount_factor",":","Determines","the","importance","of","variables","from","past","trials",".","If","the","current","trial","is","n",",","the","variables","W","of","trial","k",",","where","k","<","n",",","will","be","weighted","as","W","*","discount_factor^","(","n-k",")",".","max_completed_trials",":","The","maximum","number","of","completed","trials","to","consider","when","warm","starting","the","current","trial","variables",".","model_dir",":","The","current","model","directory","(","string",")","."]
code: def __init__(
      self,
      vars_to_warm_start,
      current_trial_id,
      completed_trials,
      discount_factor,
      max_completed_trials,
      model_dir,
  ):
      """Initializes a new BaseTransferLearningHoook instance.
  
      Args:
        vars_to_warm_start: The variables to warm start from previous trials.
        current_trial_id: The id of the current trial.
        completed_trials: The list of successfully completed trials. Will be used
          to warm start the variables of the current trial.
        discount_factor: Determines the importance of variables from past trials.
          If the current trial is n, the variables W of trial k, where k < n, will
          be weighted as W * discount_factor^(n-k).
        max_completed_trials: The maximum number of completed trials to consider
          when warm starting the current trial variables.
        model_dir: The current model directory (string).
      """
      if not vars_to_warm_start:
          tf.loggin.warning(
              "vars_to_warm_start list is empty; hook will have no "
              "effect."
          )
      self._vars_to_warm_start = vars_to_warm_start
      self._current_trial_id = current_trial_id
      self._completed_trials = completed_trials
      self._discount_factor = discount_factor
      self._max_completed_trials = max_completed_trials
      self._assign_ops = []
      self._model_dir = model_dir
  
file_path: model_search/model_search/meta/transfer_learning.py
imports: import abc
  from absl import logging
  from model_search.architecture import architecture_utils
  import tensorflow.compat.v2
label_desc: Use image node_id 1 to create a new BaseTransferLearningHook object from inherited base classes: tf.estimator with example: obj = BaseTransferLearningHook(vars_to_warm_start, current_trial_id, completed_trials, discount_factor, max_completed_trials, model_dir)