TensorFlow 1.9.0版本更新
主要的更新总结:
1. 更新了tf.keras
的 get started 和 programmers guide page文档。【中文版 Keras 教程】
2. tf.keras.layers
中增加了 tf.keras.layers.CuDNNGRU
和 tf.keras.layers.CuDNNLSTM
3. 标准 pip 安装包括了 toco
、tflite_convert
命令行工具
4. tf.keras.Model.save_weights
开始默认以 TensorFlow 格式保存参数。
5. 现在 dataset iterators 可以被传给 tf.keras.Model
的 training / eval 方法。
具体的更新内容见下面:
主要特征 及 改进
- 更新了
tf.keras
的文档:get started 和 programmers guide page(基于keras 2.1.6) - 将
tf.keras
API 更新到了 Keras 2.1.6 - 在
tf.keras.layers
中增加tf.keras.layers.CuDNNGRU
和tf.keras.layers.CuDNNLSTM
两个层,用法见 Try it - gradient boosted trees estimators 开始支持
tf.feature_column
和tf.losses
- The python interface for the TFLite Optimizing Converter has been expanded, and the command line interface (AKA:
toco
,tflite_convert
) is once again included in the standardpip
installation. ———这个即总结中的第3条 - 数据加载和文本处理方面添加了下面3个函数:
- 为新的内置 Estimators 增加了 experimental 支持:
- The distributions.Bijector API supports broadcasting for Bijectors with new API changes.
不兼容的更新
- 创建空 variable scope 的方法从
variable_scope('', ...)
变为了variable_scope(tf.get_variable_scope(), ...)
- 用于构建自定义 ops 的头文件从 site-packages/external 中移动到了 site-packages/tensorflow/include/external 中
修复的 bug 和其他的更新
-
宣布退化
tfe.Network
。 取而代之,请从tf.keras.Model
继承。虽然tfe.Network
退化了,但短期还能用。 -
下面两种情况下,层的变量的名字会发生改变:
- 在使用
tf.keras.layers
时,自定义了varibale scope - 在
tf.keras.Model
子类里使用tf.layers
。详情见 details
- 在使用
-
tf.data
:- 为了去创建嵌套的生成器,
Dataset.from_generator()
现在接收一个args
列表。 - 当指定了
shuffle=False
或seed
时,Dataset.list_files()
会产生确定的结果。 tf.contrib.data.sample_from_datasets()
和tf.contrib.data.choose_from_datasets()
使得从多个数据集中采样或确定性的选择一些元素变得容易。tf.contrib.data.make_csv_dataset()
now supports line breaks in quoted strings, and two infrequently used arguments removed.- (C++)
DatasetBase::DebugString()
is nowconst
. - (C++)
DatasetBase::MakeIterator()
已经被重命名为DatasetBase::MakeIteratorInternal()
. - (C++) 添加了
IteratorBase::Initialize()
方法以支持在 iterator 的创建过程中 raise errors。
- 为了去创建嵌套的生成器,
-
Eager Execution:
- 添加了
tf.GradientTape.stop_recording
来支持 梯度计算 过程的暂停记录。 - 更新了文档、介绍 notebools。
- 添加了
-
tf.keras
:- 将 Keras 的代码从 _impl 文件夹中移出来了,并且去除了 API 文件。
tf.keras.Model.save_weights
现在默认以 TensorFlow 格式保存参数。- 现在 dataset iterators 可以被传给
tf.keras.Model
的 training / eval 方法。
-
TensorFlow Debugger (tfdbg)
- Fix an issue in which the TensorBoard Debugger Plugin could not handle total source file size exceeding gRPC message size limit (4 MB).
-
tf.contrib
:tf.contrib.framework.zero_initializer
supports ResourceVariable.- Adding “constrained_optimization” to tensorflow/contrib.
-
Other:
- Add GCS Configuration Ops.
- Changing signature of
MakeIterator
to enable propagating error status. - KL divergence for two Dirichlet distributions.
- More consistent GcsFileSystem behavior for certain reads past EOF.
- Update benchmark for tf.scan to match ranges across eager and graph modes.
- Fixed bug in
tf.reduce_prod gradient
for complex dtypes. - Allow the use of ‘.’ in variables (e.g. “hparams.parse(‘a.b=1.0’)”), which would previously raise an error. This will correspond to an attribute name with an embedded ‘.’ symbol (e.g. ‘a.b’), which can only be accessed indirectly (e.g. through getattr and setattr). To set this up the user will first need to explicitly add the variable to the hparam object (e.g. “hparams.add_hparam(name=’a.b’, value=0.0)”).
- Benchmark for tf.scan in graph and eager modes.
- Added complex128 support to FFT, FFT2D, FFT3D, IFFT, IFFT2D, and IFFT3D.
- Making ids unique in
nn.embedding_lookup_sparse
. This helps to reduce RPC calls for looking up the embeddings when there are repeated ids in the batch. - Support indicator column in boosted trees.
- Prevent
tf.gradients()
from backpropagating through integer tensors. - LinearOperator[1D,2D,3D]Circulant added to
tensorflow.linalg
. - Conv3D, Conv3DBackpropInput, Conv3DBackpropFilter now supports arbitrary.
- Added
tf.train.Checkpoint
for reading/writing object-based checkpoints. - Added LinearOperatorKronecker, a dense-free implementation of the Kronecker Product.
- Allow LinearOperator to broadcast.
- SavedModelBuilder will now deduplicate asset names that point to files with the same basename and the same contents. Note that this may result in new asset files included in SavedModels in cases where assets with the same name but different contents were previously overwriting each other.
一个小收获: tensorflow
中的 keras
和 tensorflow
本体融合的确实深,基本上可以说:绝对兼容
来源:
TensorFlow 1.9.0版本更新:https://github.com/tensorflow/tensorflow/releases/tag/v1.9.0