509453992838a524f6442d4e0f07a034390ae1f7,layers/eight_mile/tf/layers.py,CRF,neg_log_loss,#CRF#Any#Any#Any#,2274
Before Change
:return: torch.FloatTensor: [B]
fwd_score = self((unary, tf.cast(lengths, tf.int32)), training=True)
gold_score = self.score_sentence(unary, tags, lengths)
log_likelihood = gold_score - fwd_score
return -tf.reduce_mean(log_likelihood)
After Change
lengths = tf.cast(lengths, tf.int32)
max_length = tf.reduce_max(lengths)
fwd_score = self((unary, lengths), training=True)
tags = tags[:, :max_length]
gold_score = self.score_sentence(unary, tags, lengths)
log_likelihood = gold_score - fwd_score
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: dpressel/mead-baseline
Commit Name: 509453992838a524f6442d4e0f07a034390ae1f7
Time: 2020-02-13
Author: dpressel@gmail.com
File Name: layers/eight_mile/tf/layers.py
Class Name: CRF
Method Name: neg_log_loss
Project Name: rlworkgroup/garage
Commit Name: e4b6611cb73ef7658f028831be1aa6bd85ecbed0
Time: 2020-08-14
Author: 38871737+avnishn@users.noreply.github.com
File Name: src/garage/torch/policies/deterministic_mlp_policy.py
Class Name: DeterministicMLPPolicy
Method Name: get_action
Project Name: stellargraph/stellargraph
Commit Name: 429267c276222ec57fa622039cdcc033379d9f97
Time: 2019-02-06
Author: wangzhen263@gmail.com
File Name: stellargraph/layer/gcn.py
Class Name: GCN
Method Name: node_model