当前位置:网站首页>tf. keras. layers. Timedistributed function
tf. keras. layers. Timedistributed function
2022-04-23 02:56:00 【Live up to your youth】
The function prototype
tf.keras.layers.TimeDistributed(layer,
**kwargs
)
Function description
The time distribution layer is mainly used to slice the time dimension of the input data . At each time step , Enter one item in turn , And output one item in turn .
In the diagram above , The function of the time distribution layer is in time t input data w, Output data x; In time t1 input data x, Output data y. Enter... In turn in each time slice 、 Output a data , Instead of entering multiple items directly , Output multiple .
Parameters layer For one tf.keras.layers.Layer example . The input data is at least one three-dimensional tensor , If the input data is text sequence data , The input is a three-dimensional tensor , Shape is (batch_size, time, output_dim), If the input data is video data , The input is a five-dimensional tensor , Shape is (batch_size, time, height, width, channels).
The time distribution layer is used to process data with time dimension , It is not applicable to data without time dimension such as images .
Function USES
model = tf.keras.models.Sequential([
# Embedded layer
tf.keras.layers.Embedding(len(words), 125),
# LSTM layer
tf.keras.layers.LSTM(125, return_sequences=True),
# LSTM layer
tf.keras.layers.LSTM(125, return_sequences=True),
# Fully connected in the time dimension Dense layer
tf.keras.layers.TimeDistributed(tf.keras.layers.Dense(len(words), activation="softmax"))
])
Model: "sequential"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
embedding (Embedding) (None, None, 125) 32000
lstm (LSTM) (None, None, 125) 125500
lstm_1 (LSTM) (None, None, 125) 125500
time_distributed (TimeDistr (None, None, 256) 32256
ibuted)
=================================================================
Total params: 315,256
Trainable params: 315,256
Non-trainable params: 0
_________________________________________________________________
版权声明
本文为[Live up to your youth]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220657127161.html
边栏推荐
- Close the computer port
- Linux redis - redis ha sentinel cluster construction details & redis master-slave deployment
- ROP Emporium x86_ 64 7 ~ 8 questions
- 工业互联网+危化安全生产综合管理平台怎样建
- Innovation and management based on Scrum
- Wepy learning record
- Shell learning notes -- shell processing of output stream awk
- [learn junit5 from official documents] [II] [writingtests] [learning notes]
- 《信息系统项目管理师总结》第六章 项目人力资源管理
- Step principle of logical regression in machine learning
猜你喜欢
Huawei machine test question -- deformation of hj53 Yang Hui triangle
Shell script learning notes - regular expressions
LeetCode 1450 - 1453
Source code and some understanding of employee management system based on polymorphism
Fashion MNIST dataset classification training
Innovation and management based on Scrum
ROP Emporium x86_64 7~8题
Day 3 of learning rhcsa
机器学习(周志华) 第十四章概率图模型
[wechat applet] set the bottom menu (tabbar) for the applet
随机推荐
Rhcsa day 3 operation
First knowledge of C language ~ branch statements
解决win7 中powershell挖矿占用CPU100%
TypeScript(1)
Winsock programming interface experiment: Ping
[hcip] detailed explanation of six LSAS commonly used by OSPF
The interface request takes too long. Jstack observes the lock holding
Flink learning (XI) watermark
Codeforces round 784 (Div. 4) (a - H)
eventBus
Modify the content of MySQL + PHP drop-down box
The problem of removing spaces from strings
php+mysql对下拉框搜索的内容修改
国产轻量级看板式Scrum敏捷项目管理工具
Specific field information of MySQL export table (detailed operation of Navicat client)
Table space capacity query and expansion of Oracle Database
Regular object type conversion tool - Common DOM class
Get together to watch (detailed version) eat a few cents a day
学习正则表达式选项、断言
Devil cold rice 𞓜 078 devil answers the market in Shanghai and Nanjing; Communication and guidance; Winning the country and killing and screening; The purpose of making money; Change other people's op