4251a86130e46e9d8a5e52ffc1c7f86bbd7f3f8a,tensorforce/core/preprocessing/running_standardize.py,RunningStandardize,tf_process,#RunningStandardize#Any#,48

Before Change


            )
        // print("mean estimate shape = {}".format(tf.shape(mean_estimate)))

        return tf.cond(
            pred=(count > 1),
            true_fn=(lambda: (state - mean_estimate) / (tf.maximum(x=tf.sqrt(x=variance_estimate), y=util.epsilon))),
            false_fn=(lambda: state)
        )

After Change



        with tf.control_dependencies(control_inputs=(assignment,)):
            // Mean update
            mean = tf.reduce_sum(input_tensor=(tensor - mean_estimate), axis=0)
            assignment = tf.assign_add(ref=mean_estimate, value=(mean / count))

        with tf.control_dependencies(control_inputs=(assignment,)):

            def first_run():
                // No meaningful mean and variance yet
                return tensor

            def later_run():
                // Variance update
                variance = tf.reduce_sum(input_tensor=((tensor - mean_estimate) * mean), axis=0)
                assignment = tf.assign_add(ref=variance_sum_estimate, value=variance)
                with tf.control_dependencies(control_inputs=(assignment,)):
                    variance_estimate = variance_sum_estimate / (count - 1.0)
                    // Standardize tensor
                    return (tensor - mean_estimate) / tf.maximum(x=tf.sqrt(x=variance_estimate), y=util.epsilon)

            return tf.cond(pred=(count > 1.0), true_fn=later_run, false_fn=first_run)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: reinforceio/tensorforce
Commit Name: 4251a86130e46e9d8a5e52ffc1c7f86bbd7f3f8a
Time: 2018-01-28
Author: aok25@cl.cam.ac.uk
File Name: tensorforce/core/preprocessing/running_standardize.py
Class Name: RunningStandardize
Method Name: tf_process


Project Name: reinforceio/tensorforce
Commit Name: 283d5e1f7fc211f03221b40976d41d437ed32aaf
Time: 2017-12-04
Author: aok25@cl.cam.ac.uk
File Name: tensorforce/core/optimizers/clipped_step.py
Class Name: ClippedStep
Method Name: tf_step


Project Name: reinforceio/tensorforce
Commit Name: ef00c480c4122f107f7d1ad481991d38b8da4f20
Time: 2019-08-30
Author: alexkuhnle@t-online.de
File Name: tensorforce/core/models/policy_model.py
Class Name: PolicyModel
Method Name: tf_core_update