Skip to Content
精通機器學習
book

精通機器學習

by Aurélien Géron
April 2020
Intermediate to advanced
816 pages
18h 32m
Chinese
GoTop Information, Inc.
Content preview from 精通機器學習
662
|
第十九章:大規模訓練與部署 TensorFlow 模型
當你希望模型的反應儘可能地快速
例如線上遊戲
讓人不必查詢伺服
器就可以進行預測
這絕對可以降低延遲
並且讓網站的反應更快
因為
web
服務會用到用戶的私人資料來進行預測
而且你想要保護用戶的隱
所以在用戶端進行預測
讓私人資料永遠不會離開用戶的電腦
9
對於這些情境
你可以用一種特殊的格式來匯出模型
你可以用
TensorFlow.
js JavaScript
程式庫來載入
https://tensorflow.org/js)。
接著
這個程式庫可
以使用你的模型
直接在用戶的瀏覽器裡面進行預測
TensorFlow.js
專案有個
tensorflowjs_converter
工具
可將
TensorFlow SavedModel
Keras
模型檔案轉
換成
TensorFlow.js Layers
格式
它是一個目錄
裡面有一組共享的權重檔案
進制格式
),
以及一個描述模型的結構
並連接權重檔案的
model.json
種格式經過優化
可以從
web
高效地下載
用戶可以下載這個模型
並且使用
TensorFlow.js
程式庫
在瀏覽器中進行預測
這段程式可讓你大致瞭解
JavaScript
API
長怎樣
import
* as tf from '@tensorflow/tfjs';
const
model = await tf.loadLayersModel('https://example.com/tfjs/model.json'); ...
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

下一代空间计算:AR与VR创新理论与实践

下一代空间计算:AR与VR创新理论与实践

Erin Pangilinan, Steve Lukas, Vasanth Mohan
C语言核心技术(原书第2版)

C语言核心技术(原书第2版)

Peter Prinz, Tony Crawford

Publisher Resources

ISBN: 9789865024345