def _GetModelFnOpsForMode(self, mode): """Helper for testGetDynamicRnnModelFn{Train,Eval,Infer}().""" model_fn = dynamic_rnn_estimator._get_dynamic_rnn_model_fn( self.rnn_cell, target_column=target_column_lib.multi_class_target(n_classes=2), # Only CLASSIFICATION yields eval metrics to test for. problem_type=dynamic_rnn_estimator.ProblemType.CLASSIFICATION, prediction_type=dynamic_rnn_estimator.PredictionType.MULTIPLE_VALUE, optimizer='SGD', sequence_feature_columns=self.sequence_feature_columns, context_feature_columns=self.context_feature_columns, learning_rate=0.1) labels = self.GetClassificationTargetsOrNone(mode) model_fn_ops = model_fn( features=self.GetColumnsToTensors(), labels=labels, mode=mode) return model_fn_ops
def _GetModelFnOpsForMode(self, mode): """Helper for testGetDynamicRnnModelFn{Train,Eval,Infer}().""" model_fn = dynamic_rnn_estimator._get_dynamic_rnn_model_fn( self.rnn_cell, target_column=tf.contrib.layers.multi_class_target(n_classes=2), # Only CLASSIFICATION yields eval metrics to test for. problem_type=dynamic_rnn_estimator.ProblemType.CLASSIFICATION, prediction_type=dynamic_rnn_estimator.PredictionType.MULTIPLE_VALUE, optimizer='SGD', sequence_feature_columns=self.sequence_feature_columns, context_feature_columns=self.context_feature_columns, learning_rate=0.1) labels = self.GetClassificationTargetsOrNone(mode) model_fn_ops = model_fn(features=self.GetColumnsToTensors(), labels=labels, mode=mode) return model_fn_ops