8c17debc9dc6552da8c317c0c852b55f03c80c61,slm_lab/agent/algorithm/dqn.py,DQNBase,update,#DQNBase#,146

Before Change


        """Update epsilon or boltzmann for policy after net training"""
        epi = util.s_get(self, "aeb_space.clock").get("e")
        rise = self.explore_var_end - self.explore_var_start
        slope = rise / float(self.explore_anneal_epi)
        self.explore_var = max(
            slope * (epi - 1) + self.explore_var_start, self.explore_var_end)
        // print(f"Explore var: {self.explore_var}")

After Change


                logger.debug("Updating target_net by replacing")
                self.target_net = deepcopy(self.net)
        elif self.update_type == "polyak":
            logger.debug("Updating net by averaging")
            avg_params = self.polyak_weight * net_util.flatten_params(self.target_net) + \
                (1 - self.polyak_weight) * net_util.flatten_params(self.net)
            self.target_net = net_util.load_params(self.target_net, avg_params)
        else:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 2

Instances


Project Name: kengz/SLM-Lab
Commit Name: 8c17debc9dc6552da8c317c0c852b55f03c80c61
Time: 2017-12-24
Author: kengzwl@gmail.com
File Name: slm_lab/agent/algorithm/dqn.py
Class Name: DQNBase
Method Name: update


Project Name: pyprob/pyprob
Commit Name: f749c4f713a6f365809713ca394326faf34ec34e
Time: 2018-02-16
Author: atilimgunes.baydin@gmail.com
File Name: tests/test_distributions.py
Class Name: DistributionsTestCase
Method Name: test_dist_normal


Project Name: home-assistant/home-assistant
Commit Name: 27b1d448a31da93ccb1f8f0968f083a149e1c4c6
Time: 2018-02-25
Author: 30130371+cdce8p@users.noreply.github.com
File Name: homeassistant/components/homekit/sensors.py
Class Name: TemperatureSensor
Method Name: update_temperature


Project Name: pyprob/pyprob
Commit Name: f749c4f713a6f365809713ca394326faf34ec34e
Time: 2018-02-16
Author: atilimgunes.baydin@gmail.com
File Name: tests/test_distributions.py
Class Name: DistributionsTestCase
Method Name: test_dist_uniform