[SOLVED] How does tf.keras.metrics.TopKCategoricalAccuracy differ from [email protected]?

Issue Coming from recommender systems, precisi[email protected] is a popular metric. [email protected] = number of relevant predictions in top k / k On the tensorflow docs for tf.keras.metrics.TopKCategoricalAccuracy it states Computes how often targets are in the top K predictions. https://www.tensorflow.org/api_docs/python/tf/keras/metrics/TopKCategoricalAccuracy

Continue reading

[SOLVED] How to get output_attentions of a pretrained Distilbert Model?

Issue I am using a pretrained DistilBert model: from transformers import TFDistilBertModel,DistilBertConfig dbert = ‘distilbert-base-uncased’ config = DistilBertConfig(max_position_embeddings=256 , dropout=0.2, attention_dropout=0.2, output_hidden_states=True, output_attentions=True) #or true dbert_model = TFDistilBertModel.from_pretrained(dbert, config) input_ids_in = tf.keras.layers.Input(shape=(256,), name=’input_id’, dtype=’int32′) input_masks_in = tf.keras.layers.Input(shape=(256,), name=’attn_mask’, dtype=’int32′) outputs

Continue reading