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 精通機器學習
預測時間序列
|
491
個數字
這個資訊真的不多
而且可能不實用
RNN
會在一個時步到下一個時步之間盡
量使用其他遞迴層的隱藏狀態來取得它需要的所有資訊
而且不怎麼使用最後一層的隱
藏狀態
此外
因為
SimpleRNN
層在預設情況下使用
tanh
觸發函數
預測出來的值一定介
–1
1
之間
但如果你想要使用其他的觸發函數呢
出於這兩個理由
比較好的做法
或許是將輸出層換成
Dense
它跑得比較快
而且準確度大致上相同
而且它可讓我們
選擇任何輸出觸發函數
如果你要做這種改變
也要記得將第二個
現在是最後一個
迴層的
return_sequences=True
移除
model = keras.models.Sequential([
keras.layers.SimpleRNN(20, return_sequences=True, input_shape=[None, 1]),
keras.layers.SimpleRNN(20),
keras.layers.Dense(1)
])
當你訓練這個模型時
你會看到它更快收斂
並且有一樣好的表現
此外
你也可以視需
要更換輸出觸發函數
提前幾個時步預測未來
我們到目前為止只預測下一個時步的值
但我們也可以同樣輕鬆地改變目標來預測幾個時
步之後的值
例如
要提前預測
10
個時步
你只要將目標改成提前
10
個時步
而不是提
1
個時步
)。
但如果我們想要預測接下來的
10
個值呢
第一種做法是使用我們訓練好的模型
讓它預測下一個值
再將那個值加到輸入
假裝這
個預測的值已經存在了 ...
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