Skip to Content
基于AWS的数据科学实践
book

基于AWS的数据科学实践

by Chris Fregly, Antje Barth
September 2022
Intermediate to advanced
549 pages
11h 27m
Chinese
China Electric Power Press Ltd.
Content preview from 基于AWS的数据科学实践
训练第一个模型
|
253
7.8
创建训练脚本
让我们创建一个叫做
tf_bert_reviews.py
的训练脚本,其使用
TensorFlow
和
Keras
创
建分类器。其后我们将上一章生成的特征传入分类器以训练模型。
7.8.1
划分训练、验证和测试数据集
在上一章,我们使用
SageMaker
处理任务将原始
Amazon
客户评价转换成
BERT
嵌入,
如图
7-20
所示。
数据湖
特征存储
处理任务
词汇)(
图 7-20:BERT 嵌入作为 TensorFlow 训练模型的输入
在本节,我们加载训练、验证和测试数据集为模型训练提供输入。我们将使用
TensorFlow
的
TFRecordDataset
实现来并行加载
TFRecords
并打乱数据,以防止模
型学习数据中的既有模式。
在
AI
和机器学习中,随机性是很常见的。对训练数据恰当地进行打乱
将提供足够的随机性,以防止模型学习数据在磁盘上存储或展现的模式。
“引导(
bootstrapping
)”是一种常见的技术,用于描述包含替代的随
机抽样。引导向抽样过程添加偏差(
bias
)、方差(
variance
)、置信区
间(
confidence intervals
)和其他指标。
254
|
第
7
章
在第
6
章,我们创建了
SageMaker
处理过程,使用
Hugging Face Transformers ...
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

设计机器学习系统

设计机器学习系统

Chip Huyen
Spark快速大数据分析(第2版)

Spark快速大数据分析(第2版)

Jules S. Damji, Brooke Wenig, Tathagata Das, Denny Lee

Publisher Resources

ISBN: 9787519869663