当前位置:网站首页>机器学习:梯度下降法
机器学习:梯度下降法
2022-06-24 19:28:00 【翁炜强】
import numpy as np
import tensorflow as tf
from matplotlib import pyplot as plt
x = tf.linspace(-10.0, 10.0, 100)
x=tf.Variable(x)#计算过程中x需转为变化张量
with tf.GradientTape() as tape: #追踪梯度
s=1/(1+tf.math.exp(-x))
grad=tape.gradient(s,x) #计算梯度
grad
plt.plot(x.numpy(),grad.numpy()) #x.numpy()表示数组
边栏推荐
- Antdb database online training has started! More flexible, professional and rich
- 建木持续集成平台v2.5.0发布
- Implementation of adjacency table storage array of graph
- Unity about conversion between local and world coordinates
- Blender's landscape
- dp问题集
- 即构「畅直播」上线!提供全链路升级的一站式直播服务
- 网络层 && IP
- Why are life science enterprises on the cloud in succession?
- 架构实战营 第 6 期 毕业总结
猜你喜欢

Web project deployment

socket(1)

Memcached comprehensive analysis – 3 Deletion mechanism and development direction of memcached

Understanding openstack network

【论】Deep learning in the COVID-19 epidemic: A deep model for urban traffic revitalization index

平衡二叉搜索树

【Camera基础(一)】Camera摄像头工作原理及整机架构

【吴恩达笔记】机器学习基础

Blender's landscape
![[product design and R & D collaboration tool] Shanghai daoning provides you with blue lake introduction, download, trial and tutorial](/img/0f/e0b261496d04ca3da8a7d7d19e5bf1.png)
[product design and R & D collaboration tool] Shanghai daoning provides you with blue lake introduction, download, trial and tutorial
随机推荐
队列实现原理和应用
即构「畅直播」上线!提供全链路升级的一站式直播服务
升哲科技 AI 智能防溺水服务上线
【吴恩达笔记】多变量线性回归
Vscode netless environment rapid migration development environment (VIP collection version)
socket done
Pattern recognition - 9 Decision tree
A field in the database is of JSON type and stores ["1", "2", "3"]
123. the best time to buy and sell shares III
Analyse complète Memcached – 2. Comprendre le stockage de mémoire pour Memcached
Dynamic routing protocol rip, OSPF
Analysis of BBR congestion control state machine
SYSCALL_ Define5 setsockopt code flow
Multiplexer select
Pattern recognition - 0 introduction
VSCode无网环境快速迁移开发环境(VIP典藏版)
数据链路层 && 一些其他的协议or技术
优雅的自定义 ThreadPoolExecutor 线程池
CondaValueError: The target prefix is the base prefix. Aborting.
Wireshark packet capturing skills summarized by myself