示例#1
0
            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],
                ))
示例#2
0
            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")])
示例#3
0
            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")
                    ]))