当前位置:网站首页>Tensorflow common functions
Tensorflow common functions
2022-04-23 11:28:00 【A gentleman reads the river】
List of articles
tf.nn.conv2d()
tf.nn.conv2d(
input, Input tensor , The type is float16,float32,float64; The order of tensors depends on data_format To explain
filters, The size of the sliding window , Shape is [filter_height, filter_width, in_channels, out_channels], Window height , wide , Number of channels entered , The number of output channels
strides, Sliding window moves in steps [1, strides, strides, 1] incorrect batch nucleus channels Calculation ,strides Is the actual moving step
padding, Data fill type {
'same','valid'}, The former uses 0 fill , The latter does not use
data_format='NHWC',{
"NHWC", "NCHW"} Respectively corresponding to N: Data volume ,H: Height of the image ,W: The width of the image ,C: Number of image channels
dilations=None, Optional list ,[1,1,1,1], The length is 1-D Tensor ,input Expansion coefficient of each dimension . If k>1, There will be... Between each filter element on this dimension k-1 Skip cells
name=None)
tf.nn.max_pool()
tf.nn.max_pool(
input, Input tensor (Tensor), The type is float16,float32,float64; The order of tensors depends on data_format To explain
ksize, The size of the pooled window ,[1, height, width, 1], incorrect batch nucleus channels Pooling ,height and width Is the height and width of the pooled window
strides, The step size of the pooled window movement [1, strides, strides, 1], incorrect batch nucleus channels Calculation ,strides Is the actual moving step
padding, Data fill type (string){
'same','valid'}, The former uses 0 fill , The latter does not use
data_format='NHWC', 'NHWC', Image format (string){
"NHWC", "NCHW","NCHW_VECT_C"} Respectively corresponding to N: Data volume ,H: Height of the image ,W: The width of the image ,C: Number of image channels
name=None
)
tf.nn.softmax()
tf.nn.sparse_softmax_cross_entropy_with_logits(
labels, Label tensor (Tensor), The probability distribution of the tag ,shape by [l0,l1,l2,l3...lr-1],r Is the number of categories of the label , The type is int32 perhaps int64
logits, Predictor tensor (Tensor), Predicted probability distribution ,shape by [p0,p1,p2,p3...pr-1], among r It's the number of categories , The type is float16,float32 perhaps float64
name=None
)
Save()
tf.train.Checkpoint().save()
preservation ckpt Model
tf.train.Checkpoint(
optimizer=optimizer,
encoder=encoder,
decoder=decoder
).save(file_prefix=("./model/ckpt"))# The untrained model can be saved to modl/ckpt Under the table of contents
tf.keras.Model().save()
tf.keras.Model(params).save("./model/h5")
# for example
model = tf.keras.Model()
model.fit(
inputs,
outputs,
epochs=300,
vebose=1)
mdoel.save(model_path)
tf.keras.models.save_model()
tf.keras.models.save_model(
model, To save Keras Model examples
modelpath, route (string), Location to save
overwrite=True, We are any existing model that should cover the target location , You should still use manual prompts to ask the user
include_optimizer=True, If True, Save the state of the optimization program together
save_formate=None, “tf” or “h5”, The indication is to save the model to Tensorflow SavedModel still HDF5. stay TF 2.X China and Murdoch think “tf”, stay TF 1.X China and Murdoch think “h5”
signatures=None, To use SavedModel Saved signature . Only applicable to “tf” Format . For more information , see also tf.saved_model.save Parameters in .signatures
options=None ( Applies only to saved model formats )tf.saved_model.SaveOptions object , This object specifies to save to SavedModel The option to
)
Load()
model.load_weight()
Import weight data and offset data
state = tf.train.last_checkpoint(modelpath)
model = tf.keras.Model()
model.load_weights(state)# load Weight data and offset data
tf.keras.models.load_model()
Import the whole model, including data model and structure model
model = tf.keras.models.load_model(modelpath)
版权声明
本文为[A gentleman reads the river]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231122283554.html
边栏推荐
- Promise details
- Laravel增加自定义助手函数
- MIT: label every pixel in the world with unsupervised! Humans: no more 800 hours for an hour of video
- 赛微微电科创板上市破发:跌幅达26% 公司市值44亿
- Pytorch neural network trainer
- Interpretation of biological recognition in robot programming course
- Oracle connectivity test gadget
- RebbitMQ的初步了解
- 论坛系统数据库设计
- 创客教育中的统筹方案管理模式
猜你喜欢
全网最细的短网址系统设计与实战
Interpretation of 2022 robot education industry analysis report
Yunna | how to manage the company's fixed assets and how to manage fixed assets
qt5.8 64 位静态库中想使用sqlite但静态库没有编译支持库的方法
MQ is easy to use in laravel
Nacos Foundation (6): Nacos configuration management model
初探 Lambda Powertools TypeScript
GPU, CUDA,cuDNN三者的关系总结
MIT: label every pixel in the world with unsupervised! Humans: no more 800 hours for an hour of video
Structure of C language (Advanced)
随机推荐
Blog post navigation (real-time update)
Laravel admin time range selector daterange default value problem
Share two practical shell scripts
赛微微电科创板上市破发:跌幅达26% 公司市值44亿
laravel 永远返回 JSON 响应
26. Delete duplicates in ordered array
My creation anniversary
How to quickly query 10 million pieces of data in MySQL
创客教育中的统筹方案管理模式
Usage Summary of datetime and timestamp in MySQL
Detailed introduction to paging exploration of MySQL index optimization
RebbitMQ的初步了解
分享两个实用的shell脚本
Learn go language 0x04: Code of exercises sliced in go language journey
On lambda powertools typescript
Summary of the relationship among GPU, CUDA and cudnn
PCB的注意事项
解读2022机器人教育产业分析报告
Yunna | fixed assets inventory supports multiple inventory methods (asset inventory)
mysql插入datetime类型字段不加单引号插入不成功