Пример #1
0
    def setUp(self):
        super(EncodeListwiseFeaturesTest, self).setUp()
        self.context_feature_columns = _context_feature_columns()
        self.example_feature_columns = _example_feature_columns()

        # Batch size = 2, list_size = 2.
        self.features = _features()
        self.listwise_dense_layer = feature.EncodeListwiseFeatures(
            context_feature_columns=self.context_feature_columns,
            example_feature_columns=self.example_feature_columns)
Пример #2
0
  def setUp(self):
    super(EncodeListwiseFeaturesTest, self).setUp()
    (context_feature_columns, example_feature_columns,
     custom_objects) = _get_feature_columns()
    self._context_feature_columns = context_feature_columns
    self._example_feature_columns = example_feature_columns
    self._custom_objects = custom_objects

    # Batch size = 2, list_size = 2.
    self._features = _features()
    self._listwise_dense_layer = feature.EncodeListwiseFeatures(
        context_feature_columns=self._context_feature_columns,
        example_feature_columns=self._example_feature_columns)
Пример #3
0
    def __init__(self,
                 context_feature_columns=None,
                 example_feature_columns=None,
                 name='ranking_network',
                 **kwargs):
        """Initializes the base ranking network with feature columns.

    Args:
      context_feature_columns: (dict) context feature names to columns.
      example_feature_columns: (dict) example feature names to columns.
      name: (string) name of the model.
      **kwargs: keyword arguments.
    """
        super(RankingNetwork, self).__init__(name=name, **kwargs)
        self._context_feature_columns = context_feature_columns or {}
        self._example_feature_columns = example_feature_columns or {}
        self._listwise_dense_layer = feature.EncodeListwiseFeatures(
            context_feature_columns=self._context_feature_columns,
            example_feature_columns=self._example_feature_columns)