db911d388651bbbc076d407deb837262f72846c7,tensorlayer/rein.py,,cross_entropy_reward_loss,#Any#Any#Any#Any#,40

Before Change


    

    if tf.__version__ <= "0.12":
        cross_entropy = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, targets=actions))
    else: // TF 1.0
        cross_entropy = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(labels=actions, logits=logits, name=name))

    // cross_entropy = tf.nn.sparse_softmax_cross_entropy_with_logits(logits, actions)

After Change


    try: // TF 1.0
        cross_entropy = tf.nn.sparse_softmax_cross_entropy_with_logits(labels=actions, logits=logits, name=name)
    except:
        cross_entropy = tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, targets=actions)
        // cross_entropy = tf.nn.sparse_softmax_cross_entropy_with_logits(logits, actions)
        
    try: //// TF1.0
        loss = tf.reduce_sum(tf.multiply(cross_entropy, rewards))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: tensorlayer/tensorlayer
Commit Name: db911d388651bbbc076d407deb837262f72846c7
Time: 2017-02-16
Author: dhsig552@163.com
File Name: tensorlayer/rein.py
Class Name:
Method Name: cross_entropy_reward_loss


Project Name: tensorflow/magenta
Commit Name: 812a49f6f40839ff17c45488e5f1f6380cd62ce5
Time: 2016-10-03
Author: elliotwaite@gmail.com
File Name: magenta/models/shared/melody_rnn_graph.py
Class Name:
Method Name: build_graph


Project Name: tensorlayer/tensorlayer
Commit Name: 577572f395eac98d3ad77b5f46d919cceb7c55f8
Time: 2017-03-10
Author: hansheng@refuel4.com
File Name: tensorlayer/cost.py
Class Name:
Method Name: cross_entropy_seq_with_mask