def __init__(self, candidate_dataset): super().__init__() self.query_model = tf.keras.layers.Dense(16) self.candidate_model = tf.keras.layers.Dense(16) self.task = tasks.Retrieval(metrics=metrics.FactorizedTopK( candidates=candidate_dataset.map(self.candidate_model), ks=[5], ))
def __init__(self, candidate_dataset): super().__init__() self.query_model = tf.keras.layers.Dense(16) self.candidate_model = tf.keras.layers.Dense(16) self.ctr_model = tf.keras.layers.Dense(1, activation="sigmoid") self.retrieval_task = tasks.Retrieval( metrics=metrics.FactorizedTopK( candidates=candidate_dataset.map(self.candidate_model), ks=[5])) self.ctr_task = tasks.Ranking( metrics=[tf.keras.metrics.AUC(name="ctr_auc")])
def __init__(self, candidate_dataset): super().__init__() self.query_model = tf.keras.layers.Dense(16) self.candidate_model = tf.keras.layers.Dense(16) self.task = tasks.Retrieval(metrics=metrics.FactorizedTopK( candidates=candidate_dataset.map(self.candidate_model), k=5, metrics=[ tf.keras.metrics.TopKCategoricalAccuracy( k=5, name="factorized_categorical_accuracy_at_5") ]))