1d4823c0ec446e93d00df8ca654db4b45b63b3d4,rllib/agents/dqn/tests/test_dqn.py,TestDQN,test_dqn_compilation,#TestDQN#,13

Before Change


            print(results)

        // tf.
        tf_config = config.copy()
        tf_config["eager"] = False
        trainer = dqn.DQNTrainer(config=tf_config, env="CartPole-v0")
        num_iterations = 1
        for i in range(num_iterations):
            results = trainer.train()
            print(results)

After Change


        config["num_workers"] = 0  // Run locally.
        num_iterations = 2

        for _ in framework_iterator(config, frameworks=["tf", "eager"]):
            // Rainbow.
            rainbow_config = config.copy()
            rainbow_config["num_atoms"] = 10
            rainbow_config["noisy"] = True
            rainbow_config["double_q"] = True
            rainbow_config["dueling"] = True
            rainbow_config["n_step"] = 5
            trainer = dqn.DQNTrainer(config=rainbow_config, env="CartPole-v0")
            for i in range(num_iterations):
                results = trainer.train()
                print(results)

            // double-dueling DQN.
            plain_config = config.copy()
            trainer = dqn.DQNTrainer(config=plain_config, env="CartPole-v0")
            for i in range(num_iterations):
                results = trainer.train()
                print(results)

    def test_dqn_exploration_and_soft_q_config(self):
        Tests, whether a DQN Agent outputs exploration/softmaxed actions.
        config = dqn.DEFAULT_CONFIG.copy()
        config["num_workers"] = 0  // Run locally.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: ray-project/ray
Commit Name: 1d4823c0ec446e93d00df8ca654db4b45b63b3d4
Time: 2020-04-03
Author: sven@anyscale.io
File Name: rllib/agents/dqn/tests/test_dqn.py
Class Name: TestDQN
Method Name: test_dqn_compilation


Project Name: OpenMined/PySyft
Commit Name: ae6ced7fdebc0e80cbd1d844402960f4e61ad0ba
Time: 2021-02-12
Author: xvtongye1986@163.com
File Name: src/syft/core/node/common/action/run_class_method_action.py
Class Name: RunClassMethodAction
Method Name: execute_action


Project Name: OpenMined/PySyft
Commit Name: ae6ced7fdebc0e80cbd1d844402960f4e61ad0ba
Time: 2021-02-12
Author: xvtongye1986@163.com
File Name: src/syft/core/node/common/action/get_or_set_property_action.py
Class Name: GetOrSetPropertyAction
Method Name: execute_action


Project Name: keras-team/autokeras
Commit Name: e4a5dbe7e29d64c9b095d134f0ca2a5543353dda
Time: 2019-10-20
Author: jhfjhfj1@gmail.com
File Name: autokeras/hypermodel/graph.py
Class Name: GraphHyperModel
Method Name: hyper_build