c2c9dddf6d99bfa14b8ffb65b507a6be50b0ad6e,tensorforce/models/model.py,Model,create_observe_operations,#Model#Any#Any#,945

Before Change



    def create_observe_operations(self, terminal, reward):
        // Observation
        batched_size = tf.shape(input=terminal)[0]
        observation = self.fn_observe_timestep(
            states={name: tf.stop_gradient(input=state[:batched_size]) for name, state in self.current_states.items()},
            internals={name: tf.stop_gradient(input=internal[:batched_size]) for name, internal in self.current_internals.items()},
            actions={name: tf.stop_gradient(input=action[:batched_size]) for name, action in self.current_actions.items()},

After Change


        increment_episode = tf.assign_add(ref=self.episode, value=num_episodes)
        increment_global_episode = tf.assign_add(ref=self.global_episode, value=num_episodes)

        with tf.control_dependencies(control_inputs=(increment_episode, increment_global_episode)):
            // Stop gradients
            fn = (lambda x: tf.stop_gradient(input=x[:self.buffer_index]))
            states = util.map_tensors(fn=fn, tensors=self.states_buffer)
            internals = util.map_tensors(fn=fn, tensors=self.internals_buffer)
            actions = util.map_tensors(fn=fn, tensors=self.actions_buffer)
            terminal = tf.stop_gradient(input=terminal)
            reward = tf.stop_gradient(input=reward)

            // Observation
            observation = self.fn_observe_timestep(
                states=states,
                internals=internals,
                actions=actions,
                terminal=terminal,
                reward=reward
            )

        with tf.control_dependencies(control_inputs=(observation,)):
            // Reset index
            reset_index = tf.assign(ref=self.buffer_index, value=0)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


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: a4c4a4f2d33081806397784f96b113d5b3b32c9a
Time: 2018-02-08
Author: mi.schaarschmidt@gmail.com
File Name: tensorforce/core/memories/prioritized_replay.py
Class Name: PrioritizedReplay
Method Name: tf_retrieve_timesteps


Project Name: onnx/onnx-tensorflow
Commit Name: 6dad4c27ab4ffa96e0b699b8d5925fbe2a1f9d38
Time: 2020-10-22
Author: pluradj@us.ibm.com
File Name: onnx_tf/handlers/backend/upsample.py
Class Name: Upsample
Method Name: version_7


Project Name: google/ffn
Commit Name: ce83340731ff66c88ff3d09aa7b70667b7db3f74
Time: 2018-10-28
Author: mjanusz@google.com
File Name: ffn/training/model.py
Class Name: FFNModel
Method Name: set_up_optimizer