1 Star 0 Fork 0

hitall/DRL-AutonomousVehicles

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
gocar.py 918 Bytes
一键复制 编辑 原始数据 按行查看 历史
import sys
import gym
import envs.airsim
from baselines import deepq
def callback(lcl, glb):
# stop training if reward exceeds 199999
is_solved = lcl['t'] > 100 and sum(lcl['episode_rewards'][-101:-1]) / 100 >= 199999
return is_solved
def main():
env = gym.make("AirSimCarEnv-v0")
model = deepq.models.mlp([64], layer_norm=True)
print("\n======= Training session starts for DQN Car =======")
act = deepq.learn(
env,
q_func=model,
lr=1e-3,
max_timesteps=100000,
buffer_size=50000,
exploration_fraction=1.0, #0.1,
exploration_final_eps=0.02,
print_freq=10,
param_noise=True,
checkpoint_freq=2,
learning_starts=5,
callback=callback
)
trainedModel = "car.pkl"
print("\nSaving model to", trainedModel)
act.save(trainedModel)
if __name__ == '__main__':
main()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hitall888/DRL-AutonomousVehicles.git
git@gitee.com:hitall888/DRL-AutonomousVehicles.git
hitall888
DRL-AutonomousVehicles
DRL-AutonomousVehicles
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385