1 Star 5 Fork 1

Desny/traffic_light_rl_basic

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
networks.py 451 Bytes
一键复制 编辑 原始数据 按行查看 历史
xuyanjiao 提交于 2023-03-09 10:07 . initial basic version of sumo-rl
import torch
import torch.nn as nn
import torch.nn.functional as F
device = "cuda" if torch.cuda.is_available() else "cpu"
class DqnNetwork(nn.Module):
def __init__(self, inputs, outputs):
super(DqnNetwork, self).__init__()
self.l1 = nn.Linear(inputs, 512)
self.l2 = nn.Linear(512, outputs)
def forward(self, x):
x = x.to(device)
x = F.leaky_relu(self.l1(x))
x = self.l2(x)
return x
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/desny/traffic_light_rl_basic.git
git@gitee.com:desny/traffic_light_rl_basic.git
desny
traffic_light_rl_basic
traffic_light_rl_basic
master

搜索帮助