752f17f65ff851521b00f699e32f45e14945f069,tests/algorithms/test_td.py,,test_expected_sarsa,#,174

Before Change


    pi, mdp, _ = initialize()
    alg = ExpectedSARSA(pi, mdp.info, Parameter(.1))

    alg.Q.table = np.arange(np.prod(mdp.info.size)).reshape(
        mdp.info.size).astype(np.float)

    alg._update(0, 1, 100, 1, 0)
    alg._update(1, 0, 10, 3, 1)
    alg._update(3, 1, 50, 3, 0)
    alg._update(2, 2, -100, 3, 1)

    test_q = np.array([[0, 11.395, 2, 3],
                       [4.6, 5, 6, 7],
                       [8, 9, -1, 11],

After Change



def test_expected_sarsa():
    pi, mdp, _ = initialize()
    agent = ExpectedSARSA(pi, mdp.info, Parameter(.1))

    core = Core(agent, mdp)

    // Train
    core.learn(n_steps=100, n_steps_per_fit=1, quiet=True)

    test_q = np.array([[0.10221208, 0.48411449, 0.07688765, 0.64002317],
                       [0.58525881, 5.217031, 0.06047094, 0.48214145],
                       [0.08478224, 0.28873536, 0.06543094, 4.68559],
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 20

Instances


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 752f17f65ff851521b00f699e32f45e14945f069
Time: 2019-11-12
Author: carlo.deramo@gmail.com
File Name: tests/algorithms/test_td.py
Class Name:
Method Name: test_expected_sarsa


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 752f17f65ff851521b00f699e32f45e14945f069
Time: 2019-11-12
Author: carlo.deramo@gmail.com
File Name: tests/algorithms/test_td.py
Class Name:
Method Name: test_expected_sarsa


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 752f17f65ff851521b00f699e32f45e14945f069
Time: 2019-11-12
Author: carlo.deramo@gmail.com
File Name: tests/algorithms/test_td.py
Class Name:
Method Name: test_sarsa_lambda_discrete


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 752f17f65ff851521b00f699e32f45e14945f069
Time: 2019-11-12
Author: carlo.deramo@gmail.com
File Name: tests/algorithms/test_td.py
Class Name:
Method Name: test_r_learning