b0fd7d13ff1392c60dfef432bfea7a7dd035f71f,tensorforce/models/dqfd_model.py,DQFDModel,create_tf_operations,#DQFDModel#Any#,41

Before Change


                inverted_one_hot = mask - self.actions_one_hot[action]

                // max_a([Q(s,a) + l(s,a_E,a)], l(s,a_E, a) is 0 for expert action and margin value for others
                expert_margin = self.training_output[action][:-1] + inverted_one_hot * config.expert_margin

                supervised_selector = tf.reduce_max(input_tensor=expert_margin, axis=1)

After Change


            for name, action in self.action.items():
                // Create the supervised margin loss
                // Zero for the action taken, one for all other actions, now multiply by expert margin
                one_hot = tf.one_hot(indices=action, depth=config.actions[name].num_actions)
                ones = tf.ones_like(tensor=one_hot, dtype=tf.float32)
                inverted_one_hot = ones - one_hot

                // max_a([Q(s,a) + l(s,a_E,a)], l(s,a_E, a) is 0 for expert action and margin value for others
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: reinforceio/tensorforce
Commit Name: b0fd7d13ff1392c60dfef432bfea7a7dd035f71f
Time: 2017-07-29
Author: aok25@cl.cam.ac.uk
File Name: tensorforce/models/dqfd_model.py
Class Name: DQFDModel
Method Name: create_tf_operations


Project Name: tensorflow/tpu
Commit Name: a2a75e00e06924be9d8258726cded889abc017c7
Time: 2018-01-08
Author: frankchn@google.com
File Name: cloud_tpu/models/resnet_garden/resnet_main.py
Class Name:
Method Name: resnet_model_fn


Project Name: tensorflow/tpu
Commit Name: 9de6656a779e73ac61995bd87044af21b3f37951
Time: 2018-04-19
Author: frankchn@google.com
File Name: models/experimental/amoeba_net/amoeba_net_model.py
Class Name: AmoebaNetEstimatorModel
Method Name: model_fn