f52db36a739dfd7385c7bb5c60593debbbc3a8b1,tensorforce/models/naf_model.py,NAFModel,update,#NAFModel#Any#,106

Before Change


        q_targets = batch["rewards"] + (1. - float_terminals) * self.gamma * np.squeeze(
            self.get_target_value_estimate(batch["next_states"]))

        self.session.run([self.optimize_op, self.loss, self.training_v, self.advantage, self.q], {
            self.q_targets: q_targets,
            self.actions: batch["actions"],
            self.state: batch["states"]})

    def create_outputs(self, last_hidden_layer, scope):
        
        Creates NAF specific outputs.

After Change


        q_targets = batch["rewards"] + (1. - float_terminals) * self.gamma * np.squeeze(
            self.get_target_value_estimate(batch["next_states"]))

        feed_dict = {
            self.episode_length: [len(batch["rewards"])],
            self.q_targets: q_targets,
            self.actions: batch["actions"],
            self.state: batch["states"]}

        fetches = [self.optimize_op, self.loss, self.training_v, self.advantage, self.q]
        fetches.extend(self.training_network.internal_state_outputs)
        fetches.extend(self.target_network.internal_state_outputs)

        for n, internal_state in enumerate(self.training_network.internal_state_inputs):
            feed_dict[internal_state] = self.training_internal_states[n]

        for n, internal_state in enumerate(self.target_network.internal_state_inputs):
            feed_dict[internal_state] = self.target_internal_states[n]

        fetched = self.session.run(fetches, feed_dict)

        self.training_internal_states = fetched[2:len(self.training_internal_states)]
        self.target_internal_states = fetched[2 + len(self.training_internal_states):]

    def create_outputs(self, last_hidden_layer, scope):
        
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: reinforceio/tensorforce
Commit Name: f52db36a739dfd7385c7bb5c60593debbbc3a8b1
Time: 2017-04-08
Author: mi.schaarschmidt@gmail.com
File Name: tensorforce/models/naf_model.py
Class Name: NAFModel
Method Name: update


Project Name: HyperGAN/HyperGAN
Commit Name: cb29df4dea83d69ef9f5109398b23158a8c680dc
Time: 2018-09-25
Author: martyn@255bits.com
File Name: examples/next-frame.py
Class Name: VideoFrameSampler
Method Name: _sample


Project Name: reinforceio/tensorforce
Commit Name: f52db36a739dfd7385c7bb5c60593debbbc3a8b1
Time: 2017-04-08
Author: mi.schaarschmidt@gmail.com
File Name: tensorforce/models/naf_model.py
Class Name: NAFModel
Method Name: update


Project Name: reinforceio/tensorforce
Commit Name: eced8863d432df9a3d0a3a5b02b480031c1f611c
Time: 2017-04-08
Author: mi.schaarschmidt@gmail.com
File Name: tensorforce/models/dqn_model.py
Class Name: DQNModel
Method Name: update