2c7d7120ab89fb7e69725ebc3c5eca3891b6fecb,tensorforce/core/optimizers/tf_optimizer.py,TFOptimizer,get_variables,#TFOptimizer#Any#Any#,135

Before Change


        variables = super().get_variables(only_trainable=only_trainable, only_saved=only_saved)

        if not only_trainable:
            variables.extend(self.optimizer.variables())

        return variables

After Change


        for variable in self.optimizer.weights:
            name_index = variable.name.rindex("/" + self.name + "/")
            name = variable.name[name_index + len(self.name) + 2: -2]
            if name in self.variables:
                break
            self.variables[name] = variable
        for name, value in self.optimizer._hyper.items():
            if isinstance(value, tf.Variable):
                if name in self.variables:
                    break
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: reinforceio/tensorforce
Commit Name: 2c7d7120ab89fb7e69725ebc3c5eca3891b6fecb
Time: 2019-11-29
Author: alexkuhnle@t-online.de
File Name: tensorforce/core/optimizers/tf_optimizer.py
Class Name: TFOptimizer
Method Name: get_variables


Project Name: NifTK/NiftyNet
Commit Name: c54d542084a00f2dfceb5fb792bc167d3282726e
Time: 2018-04-23
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/engine/application_driver.py
Class Name: ApplicationDriver
Method Name: _loop


Project Name: NifTK/NiftyNet
Commit Name: cd90b064de4b8d24e9419b3458c83626db356be7
Time: 2017-11-14
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/engine/application_driver.py
Class Name: ApplicationDriver
Method Name: _inference_loop