ee950b503eeed5aca3747a4bcf2a40f624b743a0,tensorforce/core/optimizers/multi_step.py,MultiStep,tf_step,#MultiStep#Any#Any#Any#Any#,49

Before Change


            // Unrolled for loop
            for _ in range(self.num_steps - 1):
                with tf.control_dependencies(control_inputs=deltas):
                    step_deltas = self.optimizer.step(
                        time=time, variables=variables, arguments=arguments, **kwargs
                    )
                    deltas = [delta1 + delta2 for delta1, delta2 in zip(deltas, step_deltas)]

            return deltas

After Change


                    step_deltas = self.optimizer.step(
                        variables=variables, arguments=arguments, **kwargs
                    )
                    deltas = [delta1 + delta2 for delta1, delta2 in zip(deltas, step_deltas)]

            return deltas

        else:
            // TensorFlow while loop
            def body(deltas):
                with tf.control_dependencies(control_inputs=deltas):
                    step_deltas = self.optimizer.step(
                        variables=variables, arguments=arguments, **kwargs
                    )
                    deltas = [delta1 + delta2 for delta1, delta2 in zip(deltas, step_deltas)]
                    return deltas

            num_steps = self.num_steps.value()
            one = tf.constant(value=1, dtype=util.tf_dtype(dtype="int"))
            deltas = self.while_loop(
                cond=util.tf_always_true, body=body, loop_vars=(deltas,),
                maximum_iterations=(num_steps - one)
            )

            return deltas
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: reinforceio/tensorforce
Commit Name: ee950b503eeed5aca3747a4bcf2a40f624b743a0
Time: 2019-01-21
Author: alexkuhnle@t-online.de
File Name: tensorforce/core/optimizers/multi_step.py
Class Name: MultiStep
Method Name: tf_step


Project Name: reinforceio/tensorforce
Commit Name: c2c9dddf6d99bfa14b8ffb65b507a6be50b0ad6e
Time: 2018-02-08
Author: aok25@cl.cam.ac.uk
File Name: tensorforce/models/model.py
Class Name: Model
Method Name: create_observe_operations


Project Name: reinforceio/tensorforce
Commit Name: 89ef2b21c7ea77929819dec7ba589c13c49bd702
Time: 2019-01-26
Author: alexkuhnle@t-online.de
File Name: tensorforce/core/optimizers/optimizer.py
Class Name: Optimizer
Method Name: tf_apply_step