caa5ccc42c3d7e0004688a91e9e4a5b42b1a8957,test/test_documentation.py,TestDocumentation,test_readme,#TestDocumentation#,158

Before Change


        agent = Agent.create(
            agent="tensorforce",
            states=dict(type="float", shape=(10,)),
            actions=dict(type="int", num_values=5),
            max_episode_timesteps=100,
            memory=10000,
            update=dict(unit="timesteps", batch_size=64),
            optimizer=dict(type="adam", learning_rate=3e-4),
            policy=dict(network="auto"),
            objective="policy_gradient",
            reward_estimation=dict(horizon=20)
        )

        // Retrieve the latest (observable) environment state
        state = get_current_state()  // (float array of shape [10])

        // Query the agent for its action decision
        action = agent.act(states=state)  // (scalar between 0 and 4)

        // Execute the decision and retrieve the current performance score
        reward = execute_decision(action)  // (any scalar float)

        // Pass feedback about performance (and termination) to the agent
        agent.observe(reward=reward, terminal=False)

After Change



            while not terminal:
                // Episode timestep
                actions = agent.act(states=states)
                states, terminal, reward = environment.execute(actions=actions)
                agent.observe(terminal=terminal, reward=reward)

        agent.close()
        environment.close()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: reinforceio/tensorforce
Commit Name: caa5ccc42c3d7e0004688a91e9e4a5b42b1a8957
Time: 2020-02-11
Author: alexkuhnle@t-online.de
File Name: test/test_documentation.py
Class Name: TestDocumentation
Method Name: test_readme


Project Name: MolSSI/QCEngine
Commit Name: 76d930ec1fe1e18300c835ddf938afd943d4ad05
Time: 2019-06-10
Author: lori.burns@gmail.com
File Name: qcengine/programs/dftd3.py
Class Name: DFTD3Harness
Method Name: compute


Project Name: MolSSI/QCEngine
Commit Name: 1895a1e954eb0ee668deffe0de9b2207b5c04c9c
Time: 2019-06-07
Author: lori.burns@gmail.com
File Name: qcengine/programs/mp2d.py
Class Name: MP2DHarness
Method Name: compute