parameters: (self,
                 problem_type,
                 prediction_type,
                 sequence_feature_columns,
                 context_feature_columns=None,
                 num_classes=None,
                 num_units=None,
                 cell_type='basic_rnn',
                 optimizer='SGD',
                 learning_rate=0.1,
                 predict_probabilities=False,
                 momentum=None,
                 gradient_clipping_norm=5.0,
                 dropout_keep_probabilities=None,
                 model_dir=None,
                 feature_engineering_fn=None,
                 config=None)
docstring: Initializes a `DynamicRnnEstimator`.
  
      The input function passed to this `Estimator` optionally contains keys
      `RNNKeys.SEQUENCE_LENGTH_KEY`. The value corresponding to
      `RNNKeys.SEQUENCE_LENGTH_KEY` must be vector of size `batch_size` where
      entry `n` corresponds to the length of the `n`th sequence in the batch. The
      sequence length feature is required for batches of varying sizes. It will be
      used to calculate loss and evaluation metrics. If
      `RNNKeys.SEQUENCE_LENGTH_KEY` is not included, all sequences are assumed to
      have length equal to the size of dimension 1 of the input to the RNN.
  
      In order to specify an initial state, the input function must include keys
      `STATE_PREFIX_i` for all `0 <= i < n` where `n` is the number of nested
      elements in `cell.state_size`. The input function must contain values for
      all state components or none of them. If none are included, then the default
      (zero) state is used as an initial state. See the documentation for
      `dict_to_state_tuple` and `state_tuple_to_dict` for further details.
      The input function can call rnn_common.construct_rnn_cell() to obtain the
      same cell type that this class will select from arguments to __init__.
  
      The `predict()` method of the `Estimator` returns a dictionary with keys
      `STATE_PREFIX_i` for `0 <= i < n` where `n` is the number of nested elements
      in `cell.state_size`, along with `PredictionKey.CLASSES` for problem type
      `CLASSIFICATION` or `PredictionKey.SCORES` for problem type
      `LINEAR_REGRESSION`.  The value keyed by
      `PredictionKey.CLASSES` or `PredictionKey.SCORES` has shape
      `[batch_size, padded_length]` in the multi-value case and shape
      `[batch_size]` in the single-value case.  Here, `padded_length` is the
      largest value in the `RNNKeys.SEQUENCE_LENGTH` `Tensor` passed as input.
      Entry `[i, j]` is the prediction associated with sequence `i` and time step
      `j`. If the problem type is `CLASSIFICATION` and `predict_probabilities` is
      `True`, it will also include key`PredictionKey.PROBABILITIES`.
  
      Args:
        problem_type: whether the `Estimator` is intended for a regression or
          classification problem. Value must be one of
          `ProblemType.CLASSIFICATION` or `ProblemType.LINEAR_REGRESSION`.
        prediction_type: whether the `Estimator` should return a value for each
          step in the sequence, or just a single value for the final time step.
          Must be one of `PredictionType.SINGLE_VALUE` or
          `PredictionType.MULTIPLE_VALUE`.
        sequence_feature_columns: An iterable containing all the feature columns
          describing sequence features. All items in the iterable should be
          instances of classes derived from `FeatureColumn`.
        context_feature_columns: An iterable containing all the feature columns
          describing context features, i.e., features that apply across all time
          steps. All items in the set should be instances of classes derived from
          `FeatureColumn`.
        num_classes: the number of classes for a classification problem. Only
          used when `problem_type=ProblemType.CLASSIFICATION`.
        num_units: A list of integers indicating the number of units in the
          `RNNCell`s in each layer.
        cell_type: A subclass of `RNNCell` or one of 'basic_rnn,' 'lstm' or 'gru'.
        optimizer: The type of optimizer to use. Either a subclass of
          `Optimizer`, an instance of an `Optimizer`, a callback that returns an
          optimizer, or a string. Strings must be one of 'Adagrad', 'Adam',
          'Ftrl', 'Momentum', 'RMSProp' or 'SGD. See `layers.optimize_loss` for
          more details.
        learning_rate: Learning rate. This argument has no effect if `optimizer`
          is an instance of an `Optimizer`.
        predict_probabilities: A boolean indicating whether to predict
          probabilities for all classes. Used only if `problem_type` is
          `ProblemType.CLASSIFICATION`
        momentum: Momentum value. Only used if `optimizer_type` is 'Momentum'.
        gradient_clipping_norm: Parameter used for gradient clipping. If `None`,
          then no clipping is performed.
        dropout_keep_probabilities: a list of dropout probabilities or `None`.
          If a list is given, it must have length `len(num_units) + 1`. If
          `None`, then no dropout is applied.
        model_dir: The directory in which to save and restore the model graph,
          parameters, etc.
        feature_engineering_fn: Takes features and labels which are the output of
          `input_fn` and returns features and labels which will be fed into
          `model_fn`. Please check `model_fn` for a definition of features and
          labels.
        config: A `RunConfig` instance.
  
      Raises:
        ValueError: `problem_type` is not one of
          `ProblemType.LINEAR_REGRESSION` or `ProblemType.CLASSIFICATION`.
        ValueError: `problem_type` is `ProblemType.CLASSIFICATION` but
          `num_classes` is not specified.
        ValueError: `prediction_type` is not one of
          `PredictionType.MULTIPLE_VALUE` or `PredictionType.SINGLE_VALUE`.
docstring_summary: Initializes a `DynamicRnnEstimator`.
docstring_tokens: Initializes a DynamicRnnEstimator .
function: def __init__(self,
                 problem_type,
                 prediction_type,
                 sequence_feature_columns,
                 context_feature_columns=None,
                 num_classes=None,
                 num_units=None,
                 cell_type='basic_rnn',
                 optimizer='SGD',
                 learning_rate=0.1,
                 predict_probabilities=False,
                 momentum=None,
                 gradient_clipping_norm=5.0,
                 dropout_keep_probabilities=None,
                 model_dir=None,
                 feature_engineering_fn=None,
                 config=None):
      """Initializes a `DynamicRnnEstimator`.
  
      The input function passed to this `Estimator` optionally contains keys
      `RNNKeys.SEQUENCE_LENGTH_KEY`. The value corresponding to
      `RNNKeys.SEQUENCE_LENGTH_KEY` must be vector of size `batch_size` where
      entry `n` corresponds to the length of the `n`th sequence in the batch. The
      sequence length feature is required for batches of varying sizes. It will be
      used to calculate loss and evaluation metrics. If
      `RNNKeys.SEQUENCE_LENGTH_KEY` is not included, all sequences are assumed to
      have length equal to the size of dimension 1 of the input to the RNN.
  
      In order to specify an initial state, the input function must include keys
      `STATE_PREFIX_i` for all `0 <= i < n` where `n` is the number of nested
      elements in `cell.state_size`. The input function must contain values for
      all state components or none of them. If none are included, then the default
      (zero) state is used as an initial state. See the documentation for
      `dict_to_state_tuple` and `state_tuple_to_dict` for further details.
      The input function can call rnn_common.construct_rnn_cell() to obtain the
      same cell type that this class will select from arguments to __init__.
  
      The `predict()` method of the `Estimator` returns a dictionary with keys
      `STATE_PREFIX_i` for `0 <= i < n` where `n` is the number of nested elements
      in `cell.state_size`, along with `PredictionKey.CLASSES` for problem type
      `CLASSIFICATION` or `PredictionKey.SCORES` for problem type
      `LINEAR_REGRESSION`.  The value keyed by
      `PredictionKey.CLASSES` or `PredictionKey.SCORES` has shape
      `[batch_size, padded_length]` in the multi-value case and shape
      `[batch_size]` in the single-value case.  Here, `padded_length` is the
      largest value in the `RNNKeys.SEQUENCE_LENGTH` `Tensor` passed as input.
      Entry `[i, j]` is the prediction associated with sequence `i` and time step
      `j`. If the problem type is `CLASSIFICATION` and `predict_probabilities` is
      `True`, it will also include key`PredictionKey.PROBABILITIES`.
  
      Args:
        problem_type: whether the `Estimator` is intended for a regression or
          classification problem. Value must be one of
          `ProblemType.CLASSIFICATION` or `ProblemType.LINEAR_REGRESSION`.
        prediction_type: whether the `Estimator` should return a value for each
          step in the sequence, or just a single value for the final time step.
          Must be one of `PredictionType.SINGLE_VALUE` or
          `PredictionType.MULTIPLE_VALUE`.
        sequence_feature_columns: An iterable containing all the feature columns
          describing sequence features. All items in the iterable should be
          instances of classes derived from `FeatureColumn`.
        context_feature_columns: An iterable containing all the feature columns
          describing context features, i.e., features that apply across all time
          steps. All items in the set should be instances of classes derived from
          `FeatureColumn`.
        num_classes: the number of classes for a classification problem. Only
          used when `problem_type=ProblemType.CLASSIFICATION`.
        num_units: A list of integers indicating the number of units in the
          `RNNCell`s in each layer.
        cell_type: A subclass of `RNNCell` or one of 'basic_rnn,' 'lstm' or 'gru'.
        optimizer: The type of optimizer to use. Either a subclass of
          `Optimizer`, an instance of an `Optimizer`, a callback that returns an
          optimizer, or a string. Strings must be one of 'Adagrad', 'Adam',
          'Ftrl', 'Momentum', 'RMSProp' or 'SGD. See `layers.optimize_loss` for
          more details.
        learning_rate: Learning rate. This argument has no effect if `optimizer`
          is an instance of an `Optimizer`.
        predict_probabilities: A boolean indicating whether to predict
          probabilities for all classes. Used only if `problem_type` is
          `ProblemType.CLASSIFICATION`
        momentum: Momentum value. Only used if `optimizer_type` is 'Momentum'.
        gradient_clipping_norm: Parameter used for gradient clipping. If `None`,
          then no clipping is performed.
        dropout_keep_probabilities: a list of dropout probabilities or `None`.
          If a list is given, it must have length `len(num_units) + 1`. If
          `None`, then no dropout is applied.
        model_dir: The directory in which to save and restore the model graph,
          parameters, etc.
        feature_engineering_fn: Takes features and labels which are the output of
          `input_fn` and returns features and labels which will be fed into
          `model_fn`. Please check `model_fn` for a definition of features and
          labels.
        config: A `RunConfig` instance.
  
      Raises:
        ValueError: `problem_type` is not one of
          `ProblemType.LINEAR_REGRESSION` or `ProblemType.CLASSIFICATION`.
        ValueError: `problem_type` is `ProblemType.CLASSIFICATION` but
          `num_classes` is not specified.
        ValueError: `prediction_type` is not one of
          `PredictionType.MULTIPLE_VALUE` or `PredictionType.SINGLE_VALUE`.
      """
      if prediction_type == rnn_common.PredictionType.MULTIPLE_VALUE:
        name = 'MultiValueDynamicRNN'
      elif prediction_type == rnn_common.PredictionType.SINGLE_VALUE:
        name = 'SingleValueDynamicRNN'
      else:
        raise ValueError(
            'prediction_type must be one of PredictionType.MULTIPLE_VALUE or '
            'PredictionType.SINGLE_VALUE; got {}'.format(prediction_type))
  
      if problem_type == constants.ProblemType.LINEAR_REGRESSION:
        name += 'Regressor'
        target_column = layers.regression_target()
      elif problem_type == constants.ProblemType.CLASSIFICATION:
        if not num_classes:
          raise ValueError('For CLASSIFICATION problem_type, num_classes must be '
                           'specified.')
        target_column = layers.multi_class_target(n_classes=num_classes)
        name += 'Classifier'
      else:
        raise ValueError(
            'problem_type must be either ProblemType.LINEAR_REGRESSION '
            'or ProblemType.CLASSIFICATION; got {}'.format(
                problem_type))
  
      if optimizer == 'Momentum':
        optimizer = momentum_opt.MomentumOptimizer(learning_rate, momentum)
      dynamic_rnn_model_fn = _get_dynamic_rnn_model_fn(
          cell_type=cell_type,
          num_units=num_units,
          target_column=target_column,
          problem_type=problem_type,
          prediction_type=prediction_type,
          optimizer=optimizer,
          sequence_feature_columns=sequence_feature_columns,
          context_feature_columns=context_feature_columns,
          predict_probabilities=predict_probabilities,
          learning_rate=learning_rate,
          gradient_clipping_norm=gradient_clipping_norm,
          dropout_keep_probabilities=dropout_keep_probabilities,
          name=name)
  
      super(DynamicRnnEstimator, self).__init__(
          model_fn=dynamic_rnn_model_fn,
          model_dir=model_dir,
          config=config,
          feature_engineering_fn=feature_engineering_fn)
function_tokens: def __init__ ( self , problem_type , prediction_type , sequence_feature_columns , context_feature_columns = None , num_classes = None , num_units = None , cell_type = 'basic_rnn' , optimizer = 'SGD' , learning_rate = 0.1 , predict_probabilities = False , momentum = None , gradient_clipping_norm = 5.0 , dropout_keep_probabilities = None , model_dir = None , feature_engineering_fn = None , config = None ) : if prediction_type == rnn_common . PredictionType . MULTIPLE_VALUE : name = 'MultiValueDynamicRNN' elif prediction_type == rnn_common . PredictionType . SINGLE_VALUE : name = 'SingleValueDynamicRNN' else : raise ValueError ( 'prediction_type must be one of PredictionType.MULTIPLE_VALUE or ' 'PredictionType.SINGLE_VALUE; got {}' . format ( prediction_type ) ) if problem_type == constants . ProblemType . LINEAR_REGRESSION : name += 'Regressor' target_column = layers . regression_target ( ) elif problem_type == constants . ProblemType . CLASSIFICATION : if not num_classes : raise ValueError ( 'For CLASSIFICATION problem_type, num_classes must be ' 'specified.' ) target_column = layers . multi_class_target ( n_classes = num_classes ) name += 'Classifier' else : raise ValueError ( 'problem_type must be either ProblemType.LINEAR_REGRESSION ' 'or ProblemType.CLASSIFICATION; got {}' . format ( problem_type ) ) if optimizer == 'Momentum' : optimizer = momentum_opt . MomentumOptimizer ( learning_rate , momentum ) dynamic_rnn_model_fn = _get_dynamic_rnn_model_fn ( cell_type = cell_type , num_units = num_units , target_column = target_column , problem_type = problem_type , prediction_type = prediction_type , optimizer = optimizer , sequence_feature_columns = sequence_feature_columns , context_feature_columns = context_feature_columns , predict_probabilities = predict_probabilities , learning_rate = learning_rate , gradient_clipping_norm = gradient_clipping_norm , dropout_keep_probabilities = dropout_keep_probabilities , name = name ) super ( DynamicRnnEstimator , self ) . __init__ ( model_fn = dynamic_rnn_model_fn , model_dir = model_dir , config = config , feature_engineering_fn = feature_engineering_fn )