60ebba7d23a946b55de9aaa34d08637e42e75d3b,examples/lqr_bbo.py,,experiment,#Any#Any#Any#Any#Any#,24

Before Change


        dataset_eval = core.evaluate(n_episodes=ep_per_fit)
        print("distribution parameters: ", distribution.get_parameters())
        J = compute_J(dataset_eval, gamma=mdp.info.gamma)
        print("J at iteration " + str(i) + ": " + str(np.mean(J)))


if __name__ == "__main__":
    optimizer = AdaptiveOptimizer(eps=0.05)

After Change


def experiment(alg, params, n_epochs, fit_per_epoch, ep_per_fit):
    np.random.seed()

    logger = Logger(alg.__name__, results_dir=None)
    logger.strong_line()
    logger.info("Experiment Algorithm: " + alg.__name__)


    // MDP
    mdp = LQR.generate(dimensions=1)

    approximator = Regressor(LinearApproximator,
                             input_shape=mdp.info.observation_space.shape,
                             output_shape=mdp.info.action_space.shape)

    policy = DeterministicPolicy(mu=approximator)

    mu = np.zeros(policy.weights_size)
    sigma = 1e-3 * np.eye(policy.weights_size)
    distribution = GaussianCholeskyDistribution(mu, sigma)

    // Agent
    agent = alg(mdp.info, distribution, policy, **params)

    // Train
    core = Core(agent, mdp)
    dataset_eval = core.evaluate(n_episodes=ep_per_fit)
    J = compute_J(dataset_eval, gamma=mdp.info.gamma)
    logger.epoch_info(0, J=np.mean(J), distribution_parameters=str(distribution.get_parameters()))

    for i in trange(n_epochs, leave=False):
        core.learn(n_episodes=fit_per_epoch * ep_per_fit,
                   n_episodes_per_fit=ep_per_fit)
        dataset_eval = core.evaluate(n_episodes=ep_per_fit)
        J = compute_J(dataset_eval, gamma=mdp.info.gamma)
        logger.epoch_info(i+1, J=np.mean(J), distribution_parameters=str(distribution.get_parameters()))


if __name__ == "__main__":
    optimizer = AdaptiveOptimizer(eps=0.05)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 16

Instances


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 60ebba7d23a946b55de9aaa34d08637e42e75d3b
Time: 2021-01-08
Author: boris.ilpossente@hotmail.it
File Name: examples/lqr_bbo.py
Class Name:
Method Name: experiment


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 8896f02f94da16afe5b3ea5330e4f99245b75d6b
Time: 2021-01-08
Author: boris.ilpossente@hotmail.it
File Name: examples/pendulum_dpg.py
Class Name:
Method Name: experiment


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 8896f02f94da16afe5b3ea5330e4f99245b75d6b
Time: 2021-01-08
Author: boris.ilpossente@hotmail.it
File Name: examples/lqr_pg.py
Class Name:
Method Name: experiment


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 60ebba7d23a946b55de9aaa34d08637e42e75d3b
Time: 2021-01-08
Author: boris.ilpossente@hotmail.it
File Name: examples/lqr_bbo.py
Class Name:
Method Name: experiment


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 8896f02f94da16afe5b3ea5330e4f99245b75d6b
Time: 2021-01-08
Author: boris.ilpossente@hotmail.it
File Name: examples/pendulum_ac.py
Class Name:
Method Name: experiment