d641cd7cf8d44d76e34076ed6df3c04154976bf4,mushroom/algorithms/td.py,TD,fit,#TD#Any#Any#,18

Before 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._gamma * q_next - q_current)

        self.approximator.fit(sa, q, **self.params["fit_params"])

    def __str__(self):

After Change


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

        s, a, r, ss, ab = self._parse(dataset)
        self._update(s, a, r, ss, ab)

    def _parse(self, dataset):
        sample = dataset[0]
        s = np.array([sample[0]])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: AIRLab-POLIMI/mushroom
Commit Name: d641cd7cf8d44d76e34076ed6df3c04154976bf4
Time: 2017-10-03
Author: boris.ilpossente@hotmail.it
File Name: mushroom/algorithms/td.py
Class Name: TD
Method Name: fit


Project Name: flow-project/flow
Commit Name: 6ea01a9990851e607937447066320d9d1686878e
Time: 2018-01-25
Author: akreidieh@gmail.com
File Name: flow/envs/base_env.py
Class Name: Env
Method Name: setup_initial_state


Project Name: david-abel/simple_rl
Commit Name: f07a371b090609696877dae73e6cb99c547cdfbb
Time: 2016-10-18
Author: david_abel@brown.edu
File Name: simple_rl/mdp/oomdp/OOMDPStateClass.py
Class Name: OOMDPState
Method Name: __init__