tf.layers.dense()
tf.layers.dense用法
dense:全连接层
相当于添加一个层,即初学的add_layer()函数
tf.layers.dense(inputs,units,activation=None,use_bias=True,kernel_initializer=None,bias_initializer=tf.zeros_initializer(),kernel_regularizer=None,bias_regularizer=None,activity_regularizer=None,kernel_constraint=None,bias_constraint=None,trainable=True,name=None,reuse=None)
其中:
inputs: 该层的输入
units: 输出的大小(维数),整数或long
activation: 使用什么激活函数(神经网络的非线性层),默认为None,不使用激活函数
use_bias: 使用bias为True(默认使用),不用bias改成False即可
kernel_initializer: Initializer function for the weight matrix. IfNone(default), weights are initialized using the default initializer used bytf.get_variable.bias_initializer: Initializer function for the bias.kernel_regularizer: Regularizer function for the weight matrix.bias_regularizer: Regularizer function for the bias.activity_regularizer: Regularizer function for the output.kernel_constraint: An optional projection function to be applied to the kernel after being updated by anOptimizer(e.g. used to implement norm constraints or value constraints for layer weights). The function must take as input the unprojected variable and must return the projected variable (which must have the same shape). Constraints are not safe to use when doing asynchronous distributed training.bias_constraint: An optional projection function to be applied to the bias after being updated by anOptimizer.trainable: Boolean, ifTruealso add variables to the graph collectionGraphKeys.TRAINABLE_VARIABLES(seetf.Variable).name: String, the name of the layer.reuse: Boolean, whether to reuse the weights of a previous layer by the same name.
(后面懒得翻译了,有空再说吧,[微笑脸])
tf.layers.dense()的更多相关文章
- 对抗生成网络-图像卷积-mnist数据生成(代码) 1.tf.layers.conv2d(卷积操作) 2.tf.layers.conv2d_transpose(反卷积操作) 3.tf.layers.batch_normalize(归一化操作) 4.tf.maximum(用于lrelu) 5.tf.train_variable(训练中所有参数) 6.np.random.uniform(生成正态数据
1. tf.layers.conv2d(input, filter, kernel_size, stride, padding) # 进行卷积操作 参数说明:input输入数据, filter特征图的 ...
- Tensorflow BatchNormalization详解:3_使用tf.layers高级函数来构建带有BatchNormalization的神经网络
Batch Normalization: 使用tf.layers高级函数来构建带有Batch Normalization的神经网络 觉得有用的话,欢迎一起讨论相互学习~Follow Me 参考文献 吴 ...
- Tensorflow BatchNormalization详解:2_使用tf.layers高级函数来构建神经网络
Batch Normalization: 使用tf.layers高级函数来构建神经网络 觉得有用的话,欢迎一起讨论相互学习~Follow Me 参考文献 吴恩达deeplearningai课程 课程笔 ...
- Tensorflow学习笔记(2):tf.nn.dropout 与 tf.layers.dropout
A quick glance through tensorflow/python/layers/core.py and tensorflow/python/ops/nn_ops.pyreveals t ...
- tensorflow 一维卷积 tf.layers.conv1()使用
在自然语言处理中,主要使用一维的卷积. API tf.layers.conv1d( inputs, filters, kernel_size, strides=1, padding='valid', ...
- TF中conv2d和kernel_initializer方法
conv2d中的padding 在使用TF搭建CNN的过程中,卷积的操作如下 convolution = tf.nn.conv2d(X, filters, strides=[1,2,2,1], pad ...
- 图融合之加载子图:Tensorflow.contrib.slim与tf.train.Saver之坑
import tensorflow as tf import tensorflow.contrib.slim as slim import rawpy import numpy as np impor ...
- tensorflow 1.0 学习:池化层(pooling)和全连接层(dense)
池化层定义在 tensorflow/python/layers/pooling.py. 有最大值池化和均值池化. 1.tf.layers.max_pooling2d max_pooling2d( in ...
- Tensorflow BatchNormalization详解:4_使用tf.nn.batch_normalization函数实现Batch Normalization操作
使用tf.nn.batch_normalization函数实现Batch Normalization操作 觉得有用的话,欢迎一起讨论相互学习~Follow Me 参考文献 吴恩达deeplearnin ...
随机推荐
- java abstract构造函数调用
构造函数是对象的基本,没有构造函数就没有对象.如果在父类中(这里就是你的抽象类)中显示的写了有参数的构造函数,在子类继承是就必须写一个构造函数来调用父类的构造函数 public abstract cl ...
- vue格式化显示json数据
已经是json格式数据的,直接用标签 <pre></pre>展示. 参考:https://www.jianshu.com/p/d98f58267e40
- hadoop配置2.6.1 centos7
上传文件(分发)的三种方式: 1.本地: -file 的模式,上传一些小的文件. 例如: -file ./test INPUT_FILE_PATH_1="/The_Man_of_Proper ...
- jsfl 将库中声音放置到时间轴上
setBrokenFrames("cz1.mp3",2); /**/ /*<--------------将库中声音放置到时间轴上------------->*/ /** ...
- 计算机&通信词典
目录 A B C Cgroups D E F G H I J K L M N NFV NFV ISG O ONF P Q R Rewrite S T U V VNFI W X Y Z A B C Cg ...
- How to Pronounce the Numbers 1 – 10
How to Pronounce the Numbers 1 – 10 Share Tweet Share Tagged With: Numbers Numbers are something you ...
- thinkphp的PHPexecl表格样式设置
/** * 以下是使用示例,对于以 //// 开头的行是不同的可选方式,请根据实际需要 * 打开对应行的注释. * 如果使用 Excel5 ,输出的内容应该是GBK编码. */ //require_o ...
- CHAR 和VARCHAR的区别
CHAR(10)是不可变长度为10的字符串,占的存储空间始终为10个字符的长度,而VARCHAR(10)是可变长度的字符串,故而可以节省空间.例如:储存"aaaaabbbbb",则 ...
- delphi注册热键方法(一)
uses windows,menus; ..... //声明 HotKey_Key: Word; HotKey_Shift: Word; procedure WMHotKey(var msg : Tm ...
- 18.3 redis 的安装
因为之前我们server不存东西 我们 发现 后打开的网页 是接手不到之前的变化,不能更新到最新的变化的. 我们需要做到server给client发最新的代码已达到同步 我们有三种做法同步到最新的代码 ...