当前位置:网站首页>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
边栏推荐
- Maker education for primary and middle school students to learn in happiness
- 怎么进行固定资产盘点,资产盘点报告如何一键生成
- Learn go language 0x06: Fibonacci closure exercise code in go language journey
- QT信号量 无法解析的错误的总结
- 博客文章导航(实时更新)
- MIT: label every pixel in the world with unsupervised! Humans: no more 800 hours for an hour of video
- laravel-admin表单验证
- 解析性能良好的机器人使用守则
- Learn go language 0x07: stringer exercise code in go language journey
- Implementation of partition table of existing data table by MySQL
猜你喜欢

解决由于找不到amd_ags_x64.dll,无法继续执行代码。重新安装程序可能会解决此问题,地平线(Forza Horizon 5)

nacos基础(6):nacos配置管理模型

进程间通信 -- 消息队列

nacos基础(7):配置管理

Cognition and R & D technology of micro robot

Nacos Basics (5): getting started with Nacos configuration

解析社交性机器人对基础科学的作用

MIT: label every pixel in the world with unsupervised! Humans: no more 800 hours for an hour of video

GPU, CUDA,cuDNN三者的关系总结

系统编程之高级文件IO(十三)——IO多路复用-select
随机推荐
怎么进行固定资产盘点,资产盘点报告如何一键生成
Summary of QT semaphore unresolved errors
QT 64 bit static version display gif
ImportError: libX11.so.6: cannot open shared object file: No such file or directory
简易投票系统数据库设计
Nacos Foundation (9): Nacos configuration management from single architecture to microservices
Summary of the relationship among GPU, CUDA and cudnn
redis优化系列(二)Redis主从原理、主从常用配置
laravel编写Console脚本
年度最尴尬的社死瞬间,是Siri给的
Oracle connectivity test gadget
QT 怎么把QWigdet变成QDialog
Analyzing the role of social robots in basic science
解决 『SunCertPathBuilderException:unable to find valid certification path to requested target』 问题
分享两个实用的shell脚本
My creation anniversary
配电房远程综合监控系统在10kV预制舱项目中的应用
Share two practical shell scripts
Get things technology network optimization - CDN resource request Optimization Practice
nacos基础(5):nacos配置入门