tensorforce.tests package

Submodules

tensorforce.tests.base_agent_test module

class tensorforce.tests.base_agent_test.BaseAgentTest

Bases: tensorforce.tests.base_test.BaseTest

Base class for tests of fundamental Agent functionality, i.e. various action types and shapes and internal states.

config = None
exclude_bool = False
exclude_bounded = False
exclude_float = False
exclude_int = False
exclude_lstm = False
exclude_multi = False
multi_config = None
test_bool()

Tests the case of one boolean action.

test_bounded_float()

Tests the case of one bounded float action, i.e. with min and max value.

test_float()

Tests the case of one float action.

test_int()

Tests the case of one integer action.

test_lstm()

Tests the case of using internal states via an LSTM layer (for one integer action).

test_multi()

Tests the case of multiple actions of different type and shape.

tensorforce.tests.base_test module

class tensorforce.tests.base_test.BaseTest

Bases: object

Base class for tests of Agent functionality.

agent = None
base_test_pass(name, environment, network_spec, **kwargs)

Basic test loop, requires an Agent to achieve a certain performance on an environment.

base_test_run(name, environment, network_spec, **kwargs)

Run test, tests whether algorithm can run and update without compilation errors, not whether it passes.

deterministic = None
pass_threshold = 0.8
pre_run(agent, environment)

Called before Runner.run.

requires_network = True

tensorforce.tests.test_constant_agent module

class tensorforce.tests.test_constant_agent.TestConstantAgent(methodName='runTest')

Bases: tensorforce.tests.base_agent_test.BaseAgentTest, unittest.case.TestCase

agent

alias of ConstantAgent

config = {'action_values': {'action': 1.0}}
deterministic = False
exclude_bool = True
exclude_bounded = True
exclude_int = True
exclude_lstm = True
exclude_multi = True
requires_network = False

tensorforce.tests.test_ddqn_agent module

class tensorforce.tests.test_ddqn_agent.TestDDQNAgent(methodName='runTest')

Bases: tensorforce.tests.base_agent_test.BaseAgentTest, unittest.case.TestCase

agent

alias of DDQNAgent

config = {'optimizer': {'learning_rate': 0.002, 'type': 'adam'}, 'repeat_update': 4, 'memory': {'capacity': 1000, 'type': 'replay'}, 'target_sync_frequency': 10, 'first_update': 64, 'batch_size': 32}
deterministic = True
exclude_bounded = True
exclude_float = True
multi_config = {'optimizer': {'learning_rate': 0.01, 'type': 'adam'}, 'repeat_update': 1, 'memory': {'capacity': 1000, 'type': 'replay'}, 'target_sync_frequency': 10, 'first_update': 16, 'batch_size': 16}

tensorforce.tests.test_dqfd_agent module

class tensorforce.tests.test_dqfd_agent.TestDQFDAgent(methodName='runTest')

Bases: tensorforce.tests.base_agent_test.BaseAgentTest, unittest.case.TestCase

agent

alias of DQFDAgent

config = {'demo_sampling_ratio': 0.2, 'memory': {'capacity': 1000, 'type': 'replay'}, 'target_sync_frequency': 10, 'first_update': 10, 'demo_memory_capacity': 100, 'batch_size': 8}
deterministic = True
exclude_bounded = True
exclude_float = True
multi_config = {'optimizer': {'learning_rate': 0.01, 'type': 'adam'}, 'target_sync_frequency': 10, 'first_update': 16, 'demo_memory_capacity': 100, 'batch_size': 16, 'repeat_update': 1, 'memory': {'capacity': 1000, 'type': 'replay'}, 'demo_sampling_ratio': 0.2}
pre_run(agent, environment)

tensorforce.tests.test_dqn_agent module

class tensorforce.tests.test_dqn_agent.TestDQNAgent(methodName='runTest')

Bases: tensorforce.tests.base_agent_test.BaseAgentTest, unittest.case.TestCase

agent

alias of DQNAgent

config = {'optimizer': {'learning_rate': 0.002, 'type': 'adam'}, 'repeat_update': 4, 'memory': {'capacity': 1000, 'type': 'replay'}, 'target_sync_frequency': 10, 'first_update': 64, 'batch_size': 32}
deterministic = True
exclude_bounded = True
exclude_float = True
multi_config = {'optimizer': {'learning_rate': 0.01, 'type': 'adam'}, 'repeat_update': 1, 'memory': {'capacity': 1000, 'type': 'replay'}, 'target_sync_frequency': 10, 'first_update': 16, 'batch_size': 16}

tensorforce.tests.test_dqn_memories module

class tensorforce.tests.test_dqn_memories.TestDQNMemories(methodName='runTest')

Bases: tensorforce.tests.base_test.BaseTest, unittest.case.TestCase

agent

alias of DQNAgent

deterministic = True
test_naive_prioritized_replay()
test_prioritized_replay()
test_replay()

tensorforce.tests.test_dqn_nstep_agent module

class tensorforce.tests.test_dqn_nstep_agent.TestDQNNstepAgent(methodName='runTest')

Bases: tensorforce.tests.base_agent_test.BaseAgentTest, unittest.case.TestCase

agent

alias of DQNNstepAgent

config = {'optimizer': {'learning_rate': 0.01, 'type': 'adam'}, 'batch_size': 8}
deterministic = True
exclude_bounded = True
exclude_float = True
exclude_multi = True

tensorforce.tests.test_naf_agent module

class tensorforce.tests.test_naf_agent.TestNAFAgent(methodName='runTest')

Bases: tensorforce.tests.base_agent_test.BaseAgentTest, unittest.case.TestCase

agent

alias of NAFAgent

config = {'optimizer': {'learning_rate': 0.001, 'type': 'adam'}, 'repeat_update': 4, 'memory': {'capacity': 1000, 'type': 'replay'}, 'explorations_spec': {'type': 'ornstein_uhlenbeck'}, 'target_sync_frequency': 10, 'first_update': 8, 'batch_size': 8}
deterministic = True
exclude_bool = True
exclude_bounded = True
exclude_int = True
exclude_lstm = True
exclude_multi = True

tensorforce.tests.test_ppo_agent module

class tensorforce.tests.test_ppo_agent.TestPPOAgent(methodName='runTest')

Bases: tensorforce.tests.base_agent_test.BaseAgentTest, unittest.case.TestCase

agent

alias of PPOAgent

config = {'batch_size': 8}
deterministic = False
multi_config = {'step_optimizer': {'learning_rate': 0.001, 'type': 'adam'}, 'batch_size': 32}

tensorforce.tests.test_quickstart_example module

class tensorforce.tests.test_quickstart_example.TestQuickstartExample(methodName='runTest')

Bases: unittest.case.TestCase

test_example()

tensorforce.tests.test_random_agent module

class tensorforce.tests.test_random_agent.TestRandomAgent(methodName='runTest')

Bases: tensorforce.tests.base_agent_test.BaseAgentTest, unittest.case.TestCase

agent

alias of RandomAgent

config = {}
deterministic = False
exclude_lstm = True
pass_threshold = 0.0
requires_network = False

tensorforce.tests.test_reward_estimation module

class tensorforce.tests.test_reward_estimation.TestRewardEstimation(methodName='runTest')

Bases: unittest.case.TestCase

test_baseline()
test_basic()
test_gae()

tensorforce.tests.test_trpo_agent module

class tensorforce.tests.test_trpo_agent.TestTRPOAgent(methodName='runTest')

Bases: tensorforce.tests.base_agent_test.BaseAgentTest, unittest.case.TestCase

agent

alias of TRPOAgent

config = {'learning_rate': 0.005, 'batch_size': 16}
deterministic = False
multi_config = {'learning_rate': 0.1, 'batch_size': 64}

tensorforce.tests.test_tutorial_code module

class tensorforce.tests.test_tutorial_code.TestTutorialCode(methodName='runTest')

Bases: unittest.case.TestCase

Validation of random code snippets as to be notified when old blog posts need to be changed.

class MyClient(*args, **kwargs)

Bases: object

execute(action)
get_state()
test_blogpost_introduction()

Test of introduction blog post examples.

test_blogpost_introduction_runner()
test_reinforceio_homepage()

Code example from the homepage and README.md.

tensorforce.tests.test_vpg_agent module

class tensorforce.tests.test_vpg_agent.TestVPGAgent(methodName='runTest')

Bases: tensorforce.tests.base_agent_test.BaseAgentTest, unittest.case.TestCase

agent

alias of VPGAgent

config = {'batch_size': 8}
deterministic = False
multi_config = {'optimizer': {'learning_rate': 0.01, 'type': 'adam'}, 'batch_size': 64}

tensorforce.tests.test_vpg_baselines module

class tensorforce.tests.test_vpg_baselines.TestVPGBaselines(methodName='runTest')

Bases: tensorforce.tests.base_test.BaseTest, unittest.case.TestCase

agent

alias of VPGAgent

deterministic = False
test_baseline_no_optimizer()
test_gae_baseline()
test_multi_baseline()
test_network_baseline()
test_states_baseline()

tensorforce.tests.test_vpg_optimizers module

class tensorforce.tests.test_vpg_optimizers.TestVPGOptimizers(methodName='runTest')

Bases: tensorforce.tests.base_test.BaseTest, unittest.case.TestCase

agent

alias of VPGAgent

deterministic = False
test_adam()
test_clipped_step()
test_evolutionary()
test_multi_step()
test_natural_gradient()
test_optimized_step()

Module contents