rlcard.agents.dmc_agent

rlcard.agents.dmc_agent.file_writer

class rlcard.agents.dmc_agent.file_writer.FileWriter(xpid: Optional[str] = None, xp_args: Optional[dict] = None, rootdir: str = '~/palaas')

Bases: object

close(successful: bool = True)None
log(to_log: Dict, tick: Optional[int] = None, verbose: bool = False)None
rlcard.agents.dmc_agent.file_writer.gather_metadata()Dict

rlcard.agents.dmc_agent.model

class rlcard.agents.dmc_agent.model.DMCAgent(state_shape, action_shape, mlp_layers=[512, 512, 512, 512, 512], exp_epsilon=0.01, device=0)

Bases: object

eval()
eval_step(state)
forward(obs, actions)
load_state_dict(state_dict)
parameters()
predict(state)
set_device(device)
share_memory()
state_dict()
step(state)
class rlcard.agents.dmc_agent.model.DMCModel(state_shape, action_shape, mlp_layers=[512, 512, 512, 512, 512], exp_epsilon=0.01, device=0)

Bases: object

eval()
get_agent(index)
get_agents()
parameters(index)
share_memory()
class rlcard.agents.dmc_agent.model.DMCNet(state_shape, action_shape, mlp_layers=[512, 512, 512, 512, 512])

Bases: torch.nn.modules.module.Module

forward(obs, actions)

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool

rlcard.agents.dmc_agent.trainer

class rlcard.agents.dmc_agent.trainer.DMCTrainer(env, load_model=False, xpid='dmc', save_interval=30, num_actor_devices=1, num_actors=5, training_device=0, savedir='experiments/dmc_result', total_frames=100000000000, exp_epsilon=0.01, batch_size=32, unroll_length=100, num_buffers=50, num_threads=4, max_grad_norm=40, learning_rate=0.0001, alpha=0.99, momentum=0, epsilon=1e-05)

Bases: object

start()
rlcard.agents.dmc_agent.trainer.compute_loss(logits, targets)
rlcard.agents.dmc_agent.trainer.learn(position, actor_models, agent, batch, optimizer, training_device, max_grad_norm, mean_episode_return_buf, lock)

Performs a learning (optimization) step.

rlcard.agents.dmc_agent.utils

rlcard.agents.dmc_agent.utils.act(i, device, T, free_queue, full_queue, model, buffers, env)
rlcard.agents.dmc_agent.utils.create_buffers(T, num_buffers, state_shape, action_shape)
rlcard.agents.dmc_agent.utils.create_optimizers(num_players, learning_rate, momentum, epsilon, alpha, learner_model)
rlcard.agents.dmc_agent.utils.get_batch(free_queue, full_queue, buffers, batch_size, lock)