![](https://img-blog.csdnimg.cn/20200501103446286.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
【TensorFlow】
.
Giyn
个人博客:https://giyn.work
联系邮箱:490601115@qq.com
展开
-
【TensorFlow】—— 使用TensorFlow实现逻辑回归
交叉熵损失函数交叉熵刻画的是实际输出(概率)与期望输出(概率)的距离,也就是交叉熵的值越小,两个概率分布就越接近。假设概率分布p为期望输出,概率分布q为实际输出,H(p,q)为交叉熵,则:H(p,q)=−∑xp(x)log q(x)H(p, q) = -\displaystyle\sum_{x}p(x)log\,q(x)H(p,q)=−x∑p(x)logq(x)keras交叉熵在keras里,使用 binary_ crossentropy 来计算二元交叉熵。代码:import tensor原创 2020-05-24 11:12:21 · 491 阅读 · 1 评论 -
【TensorFlow】—— 使用TensorFlow实现线性回归(波士顿房价数据集)
线性回归模型f(x)=ax+bf(x)= ax + bf(x)=ax+b使用 f(x)f(x)f(x) 来映射输入特征和输出值,aaa 为权重,bbb 为偏置。损失函数:MSE=1n∑i=1n(f(x)−y)2MSE = \frac{1}{n}\displaystyle \sum^n_{i=1}(f(x)-y)^2 MSE=n1i=1∑n(f(x)−y)2优化目标:找到合适的 aa...原创 2020-04-30 10:21:00 · 1075 阅读 · 1 评论