-
大小: 4.23MB文件类型: .zip金币: 1下载: 0 次发布日期: 2023-11-06
- 语言: Python
- 标签: unitypython
资源简介
unity和python对接的unity包,里面包括完整的文档和环境,当然在github上也可以下载
代码片段和文件信息
# # Unity ML Agents
# ## Proximal Policy Optimization (PPO)
# Contains an implementation of PPO as described [here](https://arxiv.org/abs/1707.06347).
from docopt import docopt
import os
from ppo.models import *
from ppo.trainer import Trainer
from unityagents import UnityEnvironment
_USAGE = ‘‘‘
Usage:
ppo () [options]
Options:
--help Show this message.
--max-steps= Maximum number of steps to run environment [default: 1e6].
--run-path= The sub-directory name for model and summary statistics [default: ppo].
--load Whether to load the model or randomly initialize [default: False].
--train Whether to train model or only run inference [default: True].
--summary-freq= Frequency at which to save training statistics [default: 10000].
--save-freq= Frequency at which to save model [default: 50000].
--gamma= Reward discount rate [default: 0.99].
--lambd= Lambda parameter for GAE [default: 0.95].
--time-horizon= How many steps to collect per agent before adding to buffer [default: 2048].
--beta= Strength of entropy regularization [default: 1e-3].
--num-epoch= Number of gradient descent steps per batch of experiences [default: 5].
--epsilon= Acceptable threshold around ratio of old and new policy probabilities [default: 0.2].
--buffer-size= How large the experience buffer should be before gradient descent [default: 2048].
--learning-rate= Model learning rate [default: 3e-4].
--hidden-units= Number of units in hidden layer [default: 64].
--batch-size= How many experiences per gradient descent update step [default: 64].
--keep-checkpoints= How many model checkpoints to keep [default: 5].
--worker-id= Number to add to communication port (5005). Used for asynchronous agent scenarios [default: 0].
‘‘‘
options = docopt(_USAGE)
print(options)
# General parameters
max_steps = float(options[‘--max-steps‘])
model_path = ‘./models/{}‘.format(str(options[‘--run-path‘]))
summary_path = ‘./summaries/{}‘.format(str(options[‘--run-path‘]))
load_model = options[‘--load‘]
train_model = options[‘--train‘]
summary_freq = int(options[‘--summary-freq‘])
save_freq = int(options[‘--save-freq‘])
env_name = options[‘‘]
keep_checkpoints = int(options[‘--keep-checkpoints‘])
worker_id = int(options[‘--worker-id‘])
# Algorithm-specific parameters for tuning
gamma = float(options[‘--gamma‘])
lambd = float(options[‘--lambd‘])
time_horizon = int(options[‘--time-horizon‘])
beta = float(options[‘--beta‘])
num_epoch = int(options[‘--num-epoch‘])
epsilon = float(options[‘--epsilon‘])
buffer_size = int(options[‘--buffer-size‘])
learning_rate = float(options[‘--learning-rate‘])
hidden_units = int(options[‘--hidden-units‘])
batch_size = int(options[‘--batch-size‘])
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-10-18 18:41 ml-agents-master\
文件 1108 2017-10-18 18:41 ml-agents-master\.gitignore
文件 3191 2017-10-18 18:41 ml-agents-master\CODE_OF_CONDUCT.md
文件 11348 2017-10-18 18:41 ml-agents-master\LICENSE
文件 1490 2017-10-18 18:41 ml-agents-master\README.md
目录 0 2017-10-18 18:41 ml-agents-master\docs\
文件 5485 2017-10-18 18:41 ml-agents-master\docs\Agents-Editor-Interface.md
文件 3335 2017-10-18 18:41 ml-agents-master\docs\Example-Environments.md
文件 7958 2017-10-18 18:41 ml-agents-master\docs\Getting-Started-with-Balance-Ball.md
文件 3021 2017-10-18 18:41 ml-agents-master\docs\Limitations-&-Common-Issues.md
文件 14901 2017-10-18 18:41 ml-agents-master\docs\Making-a-new-Unity-Environment.md
文件 1719 2017-10-18 18:41 ml-agents-master\docs\Organizing-the-Scene.md
文件 901 2017-10-18 18:41 ml-agents-master\docs\Readme.md
文件 2881 2017-10-18 18:41 ml-agents-master\docs\Training-on-Amazon-Web-Service.md
文件 3760 2017-10-18 18:41 ml-agents-master\docs\Unity-Agents---Python-API.md
文件 7034 2017-10-18 18:41 ml-agents-master\docs\Unity-Agents-Overview.md
文件 6452 2017-10-18 18:41 ml-agents-master\docs\Using-TensorFlow-Sharp-in-Unity-(Experimental).md
文件 1217 2017-10-18 18:41 ml-agents-master\docs\best-practices.md
文件 2182 2017-10-18 18:41 ml-agents-master\docs\installation.md
目录 0 2017-10-18 18:41 ml-agents-master\images\
文件 88595 2017-10-18 18:41 ml-agents-master\images\academy.png
文件 44453 2017-10-18 18:41 ml-agents-master\images\agent.png
文件 241346 2017-10-18 18:41 ml-agents-master\images\agents_diagram.png
文件 1217166 2017-10-18 18:41 ml-agents-master\images\balance.png
文件 171073 2017-10-18 18:41 ml-agents-master\images\banner.png
文件 73513 2017-10-18 18:41 ml-agents-master\images\brain.png
文件 199636 2017-10-18 18:41 ml-agents-master\images\gridworld.png
文件 76764 2017-10-18 18:41 ml-agents-master\images\internal_brain.png
文件 78014 2017-10-18 18:41 ml-agents-master\images\pla
文件 46378 2017-10-18 18:41 ml-agents-master\images\scene-hierarchy.png
文件 170182 2017-10-18 18:41 ml-agents-master\images\tennis.png
............此处省略238个文件信息
评论
共有 条评论