d58f2f8913722e0c95e665ab442da0c12a1766ae,basenji/rnn.py,RNN,build,#RNN#Any#,15

Before Change


        """

        // throw away a buffer region on the side
        outputs = outputs[self.batch_buffer:-self.batch_buffer]

        // make final predictions
        preds_length = []
        for li in range(self.batch_length - 2*self.batch_buffer):

After Change


        sq_diff = tf.squared_difference(self.preds, self.targets[:,self.batch_buffer:self.batch_length-self.batch_buffer,:])

        // set any NaN"s to zero
        nan_indexes = tf.is_nan(sq_diff)
        tens0 = tf.zeros_like(sq_diff)
        sq_diff = tf.select(nan_indexes, tens0, sq_diff)

        // take the mean
        self.loss_op = tf.reduce_mean(sq_diff)

        // define optimization
        if self.optimization == "adam":
            opt = tf.train.AdamOptimizer(self.learning_rate, self.adam_beta1, self.adam_beta2)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 4

Instances


Project Name: calico/basenji
Commit Name: d58f2f8913722e0c95e665ab442da0c12a1766ae
Time: 2016-06-24
Author: davidkelley44@gmail.com
File Name: basenji/rnn.py
Class Name: RNN
Method Name: build


Project Name: reinforceio/tensorforce
Commit Name: 98fe0142e39af4a9a2450ca3f3e48a53152f5091
Time: 2016-12-29
Author: k@ifricke.com
File Name: tensorforce/updater/deep_q_network.py
Class Name: DeepQNetwork
Method Name: create_training_operations


Project Name: MorvanZhou/tutorials
Commit Name: 780dcd9fd372afa8524a6515eec6a4c90b1494c9
Time: 2017-03-09
Author: morvanzhou@gmail.com
File Name: Reinforcement_learning_TUT/8_Actor_Critic_Advantage/AC_CartPole.py
Class Name: Actor
Method Name: __init__


Project Name: reinforceio/tensorforce
Commit Name: 67f74e592427d15578eae688f677952d8bd98d3a
Time: 2020-04-25
Author: alexkuhnle@t-online.de
File Name: tensorforce/core/distributions/categorical.py
Class Name: Categorical
Method Name: tf_parametrize


Project Name: asyml/texar
Commit Name: f55217e5fee88bc38e58e62e886f79e561c4d069
Time: 2018-08-14
Author: zhitinghu@gmail.com
File Name: texar/losses/losses_utils.py
Class Name:
Method Name: reduce_batch_time