DistributionalDQNnet¶
- class torchrl.modules.DistributionalDQNnet(*args, **kwargs)[源代码]¶
分布深度 Q 网络 softmax 层。
此层应放置在预测动作值和作用于 logit 值的分布之间的常规模型之间。
- 参数:
in_keys (list of str or tuples of str) – log-softmax 操作的输入键。默认为
["action_value"]
。out_keys (list of str or tuples of str) – log-softmax 操作的输出键。默认为
["action_value"]
。
示例
>>> import torch >>> from tensordict import TensorDict >>> net = DistributionalDQNnet() >>> td = TensorDict({"action_value": torch.randn(10, 5)}, batch_size=[10]) >>> net(td) TensorDict( fields={ action_value: Tensor(shape=torch.Size([10, 5]), device=cpu, dtype=torch.float32, is_shared=False)}, batch_size=torch.Size([10]), device=None, is_shared=False)