相关文章
Spring6-01
Spring6启示录
OCP开闭原则
什么是开闭原则? 在软件开发过程中应当对扩展开放,对修改关闭。也就是说如果在进行功能扩展的时候,添加额外的类是没有问题的,但因为功能扩展而修改之前运行正常的程序,这是不被允许的。因…
建站知识
2024/11/13 16:44:15
深入浅出TensorFlow2函数——tf.shape
分类目录:《深入浅出TensorFlow2函数》总目录 语法
tf.shape(input, out_typetf.dtypes.int32, nameNone)参数
input:tf.Tensor或tf.SparseTensorout_type:[可选] 操作的指定输出类型(int32或int64)。默认为tf.int3…
建站知识
2025/1/3 19:01:28
深入浅出TensorFlow2函数——tf.reshape
分类目录:《深入浅出TensorFlow2函数》总目录 语法
tf.reshape(tensor, shape, nameNone
)参数
返回值
返回一个新的形状为shape的tf.Tensor且具有与tensor以同样的顺序和相同的值。
实例
输入:
t1 [[1, 2, 3],[4, 5, 6]]
print(tf.shape(t1).num…
建站知识
2024/10/12 14:26:33
tensorflow中 tf.reduce_mean函数
tf.reduce_mean 函数用于计算张量tensor沿着指定的数轴(tensor的某一维度)上的的平均值,主要用作降维或者计算tensor(图像)的平均值。 reduce_mean(input_tensor,axisNone,keep_dimsFalse,nameNone,reduction_indicesN…
建站知识
2024/10/12 14:26:30
tf.transpose()
一 函数原型
tf.transpose( a, permNone, nametranspose, conjugateFalse )
a:表示的是需要变换的张量
perm:a的新的维度序列
name:操作的名字,可选的
conjugate:可选的,设置成True,那么就等于tf.conj(tf.transpose(inp…
建站知识
2025/1/24 11:42:04
tf.keras.Input函数
tf.keras.Input函数 tf.keras.Input函数用于向模型中输入数据,并指定数据的形状、数据类型等信息。其实这个函数的参数中,batch_size和sparse的意义我还没有太理解,不知道这里指定的batch_size会对后面的模型训练产生什么影响以及指定创建的占…
建站知识
2025/1/30 18:49:51
tf.estimator.EstimatorSpec讲解
作用
是一个class(类),是定义在model_fn中的,并且model_fn返回的也是它的一个实例,这个实例是用来初始化Estimator类的 (Ops and objects returned from a model_fn and passed to an Estimator.)
具体细节
Creates…
建站知识
2024/10/12 14:26:24
tf.Keras.Model类总结
文章目录 tf.keras.Model类1. 创建一个tf.keras.Model类实例的方法1.1 通过指定输入输出进行实例化1.2 通过继承Model类进行实例化 2. tf.Keras.Model类属性3. compile方法4. evaluate方法5. evaluate_generator方法6. fit方法7. fit_generator方法8. predict方法9. predict_ge…
建站知识
2024/12/20 8:18:29