人工智能之Tensorflow编程模型

慈云数据 8个月前 (03-13) 技术支持 107 0

下述操作都是基于:tensorflow-2.15.0
安装命令: pip install -i https://mirrors.aliyun.com/pypi/simple tensorflow
Python下载:https://registry.npmmirror.com/binary.html?path=python/3.9.13/

在这里插入图片描述

TensorFlow是用数据流图做计算的,因此需要先创建一个数据流图。以一个简单的回归模型为例,其中与模型有关的元素输入(Input)、重塑(Reshape)、ReLU层(ReLU Layer)、Logit层(Logit Layer)、Softmax、交叉熵(Crossentropy)、梯度(Gradient)、SGD训练(SGD Trainer)等部分。计算过程:

  1. 输入
  2. 重塑
  3. ReLU层会有两个参数,即 W h 1 W_{h1} Wh1​和 b h 1 b_{h1} bh1​,在输出前用ReLU激活函数做非线性处理。
  4. Logit层(输出),学习两个参数 W s m W_{sm} W
微信扫一扫加客服

微信扫一扫加客服

点击启动AI问答
Draggable Icon