摘要:
实现方式 以 ℓ2 Regularization 为例,主要有两种实现方式 1. 手动累加 2. 借助于 kernel_regularizer 实例验证 import tensorflow as tf # 1. create data from tensorflow.examples.tutoria 阅读全文
摘要:
上一篇的模型保存和恢复熟练后,我们就可以大量使用 pretrain model 来训练任务了 Tweaking, Dropping, or Replacing the Upper Layers The output layer of the original model should usually 阅读全文
摘要:
模型文件 tensorflow 训练保存的模型注意包含两个部分:网络结构和参数值。 .meta .meta 文件以 “protocol buffer”格式保存了整个模型的结构图,模型上定义的操作等信息。 查看 meta 文件中所有的操作信息: # # # 列出 meta 中所有操作 # # # sa 阅读全文
摘要:
梯度修剪 梯度修剪主要避免训练梯度爆炸的问题,一般来说使用了 Batch Normalization 就不必要使用梯度修剪了,但还是有必要理解下实现的 In TensorFlow, the optimizer’s minimize() function takes care of both comp 阅读全文
摘要:
参考:tensorflow中的batch_norm以及tf.control_dependencies和tf.GraphKeys.UPDATE_OPS的探究 1. Batch Normalization 对卷积层来说,批量归一化发生在卷积计算之后、应用激活函数之前。训练阶段:如果卷积计算输出多个通道, 阅读全文
摘要:
0. tf.train.Optimizer tensorflow 里提供了丰富的优化器,这些优化器都继承与 Optimizer 这个类。class Optimizer 有一些方法,这里简单介绍下: 0.1. minimize loss: A Tensor containing the value t 阅读全文
摘要:
In general ELU > leaky ReLU(and its variants) > ReLU > tanh > logistic. If you care a lot about runtime performance, then you may prefer leaky ReLUs o 阅读全文
摘要:
file: tensorflow/python/training/learning_rate_decay.py 参考:tensorflow中常用学习率更新策略 神经网络中通过超参数 learning rate,来控制每次参数更新的幅度。学习率太小会降低网络优化的速度,增加训练时间;学习率太大则可能导 阅读全文
摘要:
方法定义 tf.nn.conv2d(input, filter, strides, padding, use_cudnn_on_gpu=True, data_format="NHWC", dilations=[1,1,1,1], name=None) 参数: input: 输入的要做卷积的数据体,要 阅读全文
摘要:
基本使用 使用graph来表示计算任务 在被称之为Session的上下文中执行graph 使用tensor表示数据 通过Variable维护状态 使用feed和fetch可以为任意的操作(op)赋值或者取数据 综述 TensorFlow 是一个编程系统, 使用图来表示计算任务. 图中的节点被称之为 阅读全文