-
大小: 41.85MB文件類型: .zip金幣: 1下載: 0 次發(fā)布日期: 2023-06-21
- 語言: Python
- 標(biāo)簽:
資源簡介
該框架利用多核CPU處理能力,用于訓(xùn)練和評估增強(qiáng)學(xué)習(xí)Agent。Coach包含一些領(lǐng)先的增強(qiáng)學(xué)習(xí)算法的多線程實(shí)現(xiàn),適用于各種游戲和機(jī)器人環(huán)境。它能夠在臺式計(jì)算機(jī)上高效地訓(xùn)練強(qiáng)化學(xué)習(xí)Agent,而無需任何額外的硬件。
代碼片段和文件信息
#
#?Copyright?(c)?2017?Intel?Corporation
#
#?Licensed?under?the?Apache?License?Version?2.0?(the?“License“);
#?you?may?not?use?this?file?except?in?compliance?with?the?License.
#?You?may?obtain?a?copy?of?the?License?at
#
#??????http://www.apache.org/licenses/LICENSE-2.0
#
#?Unless?required?by?applicable?law?or?agreed?to?in?writing?software
#?distributed?under?the?License?is?distributed?on?an?“AS?IS“?BASIS
#?WITHOUT?WARRANTIES?OR?CONDITIONS?OF?ANY?KIND?either?express?or?implied.
#?See?the?License?for?the?specific?language?governing?permissions?and
#?limitations?under?the?License.
#
import?sys
from?codecs?import?open
from?os?import?path
from?setuptools?import?setup?find_packages
import?subprocess
#?Creating?the?pip?package?involves?the?following?steps:
#?-?Define?the?pip?package?related?files?-?setup.py?(this?file)?and?MANIFEST.in?by:
#?1.?Make?sure?all?the?requirements?in?install_requires?are?defined?correctly?and?that?their?version?is?the?correct?one
#?2.?Add?all?the?non?.py?files?to?the?package_data?and?to?the?MANIFEST.in?file
#?3.?Make?sure?that?all?the?python?directories?have?an?__init__.py?file
#?-?Check?that?everything?works?fine?by:
#?1.?Create?a?new?virtual?environment?using?‘virtualenv?coach_env?-p?python3‘
#?2.?Run?‘pip?install?-e?.‘
#?3.?Run?‘coach?-p?CartPole_DQN‘?and?make?sure?it?works
#?4.?Run?‘dashboard‘?and?make?sure?it?works
#?-?If?everything?works?fine?build?and?upload?the?package?to?PyPi:
#?1.?Update?the?version?of?Coach?in?the?call?to?setup()
#?2.?Remove?the?directories?build?dist?and?rl_coach.egg-info?if?they?exist
#?3.?Run?‘python?setup.py?sdist‘
#?4.?Run?‘twine?upload?dist/*‘
slim_package?=?False??#?if?true?build?aws?package?with?partial?dependencies?otherwise?build?full?package
here?=?path.abspath(path.dirname(__file__))
#?Get?the?long?description?from?the?README?file
with?open(path.join(here?‘README.md‘)?encoding=‘utf-8‘)?as?f:
????long_description?=?f.read()
install_requires?=?list()
extras?=?dict()
excluded_packages?=?[‘kubernetes‘?‘tensorflow‘]?if?slim_package?else?[]
with?open(path.join(here?‘requirements.txt‘)?‘r‘)?as?f:
????for?line?in?f:
????????package?=?line.strip()
????????if?any(p?in?package?for?p?in?excluded_packages):
????????????continue
????????install_requires.append(package)
#?check?if?system?has?CUDA?enabled?GPU
p?=?subprocess.Popen([‘command?-v?nvidia-smi‘]?stdout=subprocess.PIPE?shell=True)
out?=?p.communicate()[0].decode(‘UTF-8‘)
using_GPU?=?out?!=?‘‘
if?not?using_GPU:
????if?not?slim_package:
????????#?For?linux?wth?no?GPU?we?install?the?Intel?optimized?version?of?TensorFlow
????????if?sys.platform?==?“l(fā)inux“?or?sys.platform?==?“l(fā)inux2“:
????????????install_requires.append(‘intel-tensorflow>=1.9.0‘)
????????else:
????????????install_requires.append(‘tensorflow>=1.9.0‘)
????extras[‘mxnet‘]?=?[‘mxnet-mkl>=1.3.0‘]
else:
????if?not?slim_package:
????????install_requires.append(‘tensorflow-gpu>=1.9.0‘)
????extras[‘mxnet‘]?=?[‘mxnet-cu90mkl>=1.3.0‘]
all_deps?=?[]
for?group_name?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-07-24?13:10??NervanaSystems-coach-2697142\
?????目錄???????????0??2019-07-24?13:10??NervanaSystems-coach-2697142\.circleci\
?????文件???????36431??2019-07-24?13:10??NervanaSystems-coach-2697142\.circleci\config.yml
?????文件?????????314??2019-07-24?13:10??NervanaSystems-coach-2697142\.gitignore
?????文件???????????0??2019-07-24?13:10??NervanaSystems-coach-2697142\.nojekyll
?????文件????????6047??2019-07-24?13:10??NervanaSystems-coach-2697142\CONTRIBUTING.md
?????文件???????11356??2019-07-24?13:10??NervanaSystems-coach-2697142\LICENSE
?????文件?????????308??2019-07-24?13:10??NervanaSystems-coach-2697142\MANIFEST.in
?????文件???????15753??2019-07-24?13:10??NervanaSystems-coach-2697142\README.md
?????文件???????????0??2019-07-24?13:10??NervanaSystems-coach-2697142\__init__.py
?????目錄???????????0??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\
?????文件????????3372??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\README.md
?????目錄???????????0??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\a3c\
?????文件????????1400??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\a3c\README.md
?????文件???????87771??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\a3c\ant_a3c_16_workers.png
?????文件???????67813??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\a3c\half_cheetah_a3c_16_workers.png
?????文件??????118324??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\a3c\hopper_a3c_16_workers.png
?????文件??????182003??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\a3c\inverted_pendulum_a3c.png
?????文件???????62816??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\a3c\space_invaders_a3c_16_workers.png
?????文件??????120974??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\a3c\walker2d_a3c_16_workers.png
?????目錄???????????0??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\acer\
?????文件?????????725??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\acer\README.md
?????文件???????66513??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\acer\breakout_acer_16_workers.png
?????文件???????61713??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\acer\pong_acer_16_workers.png
?????文件???????61938??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\acer\space_invaders_acer_16_workers.png
?????目錄???????????0??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\bootstrapped_dqn\
?????文件?????????784??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\bootstrapped_dqn\README.md
?????文件???????93194??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\bootstrapped_dqn\breakout_bootstrapped_dqn.png
?????文件???????55882??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\bootstrapped_dqn\pong_bootstrapped_dqn.png
?????文件???????60284??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\bootstrapped_dqn\space_invaders_bootstrapped_dqn.png
?????目錄???????????0??2019-07-24?13:10??NervanaSystems-coach-2697142\benchmarks\clipped_ppo\
............此處省略1016個文件信息
評論
共有 條評論