Skip to Content
Ray 分布式机器学习:利用Ray 进行大模型的数据处理、训练、推理和部署
book

Ray 分布式机器学习:利用Ray 进行大模型的数据处理、训练、推理和部署

by Max Pumperla, Edward Oakes, Richard Liaw
May 2024
Intermediate
252 pages
5h 31m
Chinese
China Machine Press
Content preview from Ray 分布式机器学习:利用Ray 进行大模型的数据处理、训练、推理和部署
利用
Ray RLlib
进行强化学习
|
103
时文件夹中
21
1
from ray.rllib.algorithms.dqn import DQNConfig
import tempfile
temp = tempfile.mkdtemp()
trainer = (
DQNConfig()
.environment(env=CurriculumEnv, env_task_fn=curriculum_fn)
.offline_data(output=temp)
.build()
)
for i in range(15):
trainer.train()
创建
temp
文件以存储训练数据,以备后用。
CurriculumEnv
设置为配置中
environment
部分中的环境,并将
curriculum_
fn
分配给属性
env_task_fn
使用
offline_data
方法将输出存储到
temp
文件夹中。
运行该算法,应该看到随着时间的推移,任务难度逐渐增加,从而使算法能够
从简单的示例开始学习,并逐渐进展到更困难的任务。
课程学习是很好的技术,
RLlib
支持通过刚刚讨论的课程
API
轻松将其纳入算法
训练中。
4.5.3
使用离线数据
在之前的课程学习示例中,我们将训练数据存储到临时文件夹中。有趣的是,
你已经从第
3
章中了解到,在
Q
学习中,你可以先收集经验数据,然后决定何
时在训练步骤中使用它。拆分数据收集和训练提供了许多可能性。例如,也许
你有
一个很好的方法,可以以一种不完美但合理的方式解决问题
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

通过可观测性确保数据与AI的可靠性

通过可观测性确保数据与AI的可靠性

Barr Moses, Michael Segner

Publisher Resources

ISBN: 9787111753384