3349fef9b5b79df88b2552c675b7f79f9ba6e59d,PyPi/algorithms/td.py,TD,fit,#TD#Any#Any#,17

Before Change


        
        assert n_iterations == 1 and len(dataset) == 1

        state, action, reward, next_state, absorbing, _ = parse_dataset(dataset)

        sa = [state, action]

        q_current = self.approximator.predict(sa)

After Change


        assert n_iterations == 1 and len(dataset) == 1

        sample = dataset[0]
        sa = [np.array([sample[0]]), np.array([sample[1]])]

        q_current = self.approximator.predict(sa)
        q_next = self._next_q(np.array([sample[3]])) if not sample[4] else 0.

        q = q_current + self.learning_rate(sa) * (
            sample[2] + self.mdp_info["gamma"] * q_next - q_current)

        self.approximator.fit(sa, q, **self.params["fit_params"])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 14

Instances


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 3349fef9b5b79df88b2552c675b7f79f9ba6e59d
Time: 2017-08-26
Author: carlo.deramo@gmail.com
File Name: PyPi/algorithms/td.py
Class Name: TD
Method Name: fit


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 3349fef9b5b79df88b2552c675b7f79f9ba6e59d
Time: 2017-08-26
Author: carlo.deramo@gmail.com
File Name: PyPi/algorithms/td.py
Class Name: SpeedyQLearning
Method Name: fit


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 3349fef9b5b79df88b2552c675b7f79f9ba6e59d
Time: 2017-08-26
Author: carlo.deramo@gmail.com
File Name: PyPi/algorithms/td.py
Class Name: DoubleQLearning
Method Name: fit


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 3349fef9b5b79df88b2552c675b7f79f9ba6e59d
Time: 2017-08-26
Author: carlo.deramo@gmail.com
File Name: PyPi/algorithms/td.py
Class Name: TD
Method Name: fit