9bcf05406490ca72b698db24636e5f2a51a5c82a,neuron/metrics.py,CategoricalCrossentropy,loss,#CategoricalCrossentropy#Any#Any#,75
Before Change
// add prior to form posterior
if self.log_prior is not None:
prior = next(self.log_prior)
ps = prior.shape
prior = np.reshape(prior, (ps[0], np.prod(ps[1:4] ), ps[4]))
// prior to keras
if self.use_float16:
k_prior = K.variable(prior, dtype="float16")
else:
k_prior = K.variable(prior)
log_post += K.log(K.clip(k_prior, K.epsilon(), 1))
// loss
loss = - y_true * log_post
After Change
// take the mean loss
mloss = K.mean(K.sum(K.cast(loss, "float32"), -1))
tf.verify_tensor_all_finite(mloss, "Loss not finite")
return mloss
class Dice(object):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances Project Name: adalca/neuron
Commit Name: 9bcf05406490ca72b698db24636e5f2a51a5c82a
Time: 2017-06-14
Author: adalca@sumac.csail.mit.edu
File Name: neuron/metrics.py
Class Name: CategoricalCrossentropy
Method Name: loss
Project Name: catalyst-cooperative/pudl
Commit Name: fc44c71d4aa2e8a5ef60effd4bfe7fb82dffbf17
Time: 2021-01-06
Author: rousik@gmail.com
File Name: src/pudl/extract/ferc1.py
Class Name: Ferc1Datastore
Method Name: get_file
Project Name: catalyst-cooperative/pudl
Commit Name: fc44c71d4aa2e8a5ef60effd4bfe7fb82dffbf17
Time: 2021-01-06
Author: rousik@gmail.com
File Name: src/pudl/extract/excel.py
Class Name: GenericExtractor
Method Name: load_excel_file