Sigmoid函数求导
基础知识:
Sigmoid函数:
Sigmoid图形:
生成Sigmoid图形代码:
import torch
from d2l import torch as d2l
%matplotlib inline
x=torch.arange(-8.0,8.0,0.1,requires_grad=True)
sigmoid=torch.nn.Sigmoid()
y=sigmoid(x)
d2l.plot(x.detach(),y.detach(),'x','sigmoid(x)',figsize=(5,2.5))
求导过程:
故Sigmoid函数的求导结果为:
参考链接:https://zhuanlan.zhihu.com/p/452684332
意在交流学习,欢迎点赞评论🙏, 如有谬误,请联系指正。