TensorFlow2.4
飞奔的帅帅
马云给你还花呗
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
keras实现share Embedding
来源:The Functional APIShared layersAnother good use for the functional API are models that use shared layers. Shared layers are layer instances that are reused multiple times in the same model -- they learn features that correspond to multiple paths in原创 2022-02-23 18:07:38 · 698 阅读 · 0 评论 -
tf.strings.split
tf.strings.splitlines = tf.strings.split(line, '\n')输入是list格式输出是一个SparseTensorValue对象SparseTensorValue(indices,values=array( ,dtype),dense_shape)拿结果lines.values原创 2021-05-11 10:41:00 · 1040 阅读 · 0 评论 -
打印dataset
eager模式import tensorflow as tfimport tensorflow.contrib.eager as tfetfe.enable_eager_execution()# 读hdfs# file_base_path="hdfs:///****"# files = tf.io.gfile.glob(file_base_path)# 读本地文件files = [os.path.join(path, f) for f in os.listdir(path)]d原创 2021-05-10 20:02:05 · 761 阅读 · 0 评论 -
jupyter环境下用tensorflow读取hdfs数据
tensorflow读取hdfs数据设置classpath变量直接执行如下脚本test.pyimport tensorflow as tf file_path = "hdfs:///a/b/.csv"files = tf.io.gfile.glob(file_path)print(files)1、shell中这样运行CLASSPATH=$($HADOOP_HDFS_HOME/bin/hadoop classpath --glob) python test.py2、.bashr原创 2021-05-08 15:49:55 · 1459 阅读 · 0 评论 -
tf.keras.layers.BatchNormalization
tf.keras.layers.BatchNormalization批归一化 批标准化tf.keras.layers.BatchNormalization( axis=-1, momentum=0.99, epsilon=0.001, center=True, scale=True, beta_initializer='zeros', gamma_initializer='ones', moving_mean_initializer='zeros', moving_原创 2021-04-23 21:25:30 · 1150 阅读 · 0 评论 -
Keras定义Layer和Model
自定义Layertf.keras.layers.Layer 是所有 Keras 层的基类,它继承自 tf.Module。定义call 您只需换出父项,然后将 __call__ 更改为 call 即可将模块转换为 Keras 层定义build 定义输入的shape.build 仅被调用一次,而且是使用输入形状时调用的。它通常用于创建变量(权重)import tensorflow as tfclass MyLayer(tf.keras.layers.Layer): ...原创 2021-04-11 16:31:58 · 2125 阅读 · 0 评论 -
tensorflow变量初始化
tensorflow变量初始化原创 2021-04-10 23:52:33 · 756 阅读 · 0 评论
分享