Tensorflow 使用经验积累

本文主要记录了 Tensorflow 的使用经验,包括 Tensorflow 的基本使用、Tensorflow 的高级使用、Tensorflow 的实现原理等。

一些基础知识

Tensor 的一些实例

Specific Instances Of Tensors, each of these examples are specific instances of the more general concept of a tensor and can be categorize into two groups:

Let’s organize the above list of example tensors into two groups:

1
2
number, array, 2d-array # 数字,数组,二维数组
scalar, vector, matrix # 标量,向量,矩阵

The first group of three terms (number, array, 2 d-array) are terms that are typically used in computer science, while the second group (scalar, vector, matrix) are terms that are typically used in mathematics.

Tensor 的乘法

$$
output[\cdots,i,j] = {sum-k}(a[\cdots,i,k]*b[\cdots, k,j])
$$

$$
\begin{matrix} &\begin{matrix}a:2 \times 3 \times 2 \ b: 2 \times 2 \times 3\end{matrix} & \Rightarrow \begin{matrix} ab:2\times3\times3 \ ba:2\times 2 \times 2 \end{matrix}\end{matrix}
$$

神经网络训练,第一个维度是 batch,是因为第一个维度不参与求和过程(和神经网络框架有关, TensorFlow 是这样的)。

设置 Batch Size

Keras Lambda Layer

遇到的问题及解决方案

TensorFlow Breaking Changes

Tensorflow 使用经验积累

https://latexalpha.github.io/4c4e6d22c4ab/

作者

Shangyu ZHAO

发布于

2024-01-03

更新于

2024-04-19

许可协议