98c6d3bc803e5d04be425e6b2eabca3ea707ed0e,finetune/nn/target_blocks.py,,_apply_class_weight,#,134

Before Change


        weights = (
            tf.reduce_sum(input_tensor=class_weights * tf.cast(targets, dtype=tf.float32), axis=1)
        )
        weights *= tf.cast(tf.reduce_prod(input_tensor=tf.shape(input=weights)), dtype=tf.float32) / tf.reduce_sum(
            input_tensor=weights
        )
        losses *= tf.expand_dims(weights, 1)
    return losses

After Change


            tf.cast(
                tf.reduce_prod(input_tensor=tf.shape(input=weights)), dtype=tf.float32
            ),
            tf.reduce_sum(input_tensor=weights),
        )
        losses *= tf.expand_dims(weights, 1)
    return losses

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: IndicoDataSolutions/finetune
Commit Name: 98c6d3bc803e5d04be425e6b2eabca3ea707ed0e
Time: 2020-08-24
Author: madison@indico.io
File Name: finetune/nn/target_blocks.py
Class Name:
Method Name: _apply_class_weight


Project Name: ylongqi/openrec
Commit Name: f08653c95fbbff7db73244b97839caf10883a7ff
Time: 2018-03-27
Author: tonyxuan26@foxmail.com
File Name: openrec/modules/interactions/ns_eu_dist.py
Class Name: NSEuDist
Method Name: _build_training_graph


Project Name: cheungdaven/DeepRec
Commit Name: a6c93234c876777d9fe45ee719eff72c41ae1c49
Time: 2019-05-14
Author: cheungdaven@gmail.com
File Name: models/seq_rec/AttRec.py
Class Name: AttRec
Method Name: build_network