- 博客(23)
- 资源 (94)
- 收藏
- 关注
原创 Tensorflow用SVM(高斯核函数)分类非线性数据
如果想分割非线性数据集,该如何改变线性分类器映射到数据集?答案是,改变SVM损失函数中的核函数。# Illustration of Various Kernels#----------------------------------## This function wll illustrate how to# implement various kernels in TensorF...
2018-02-27 18:09:46 8340 4
原创 Tensorflow用支持向量机来拟合线性回归
支持向量机可以用来拟合线性回归。 相同的最大间隔(maximum margin)的概念应用到线性回归拟合。代替最大化分割两类目标是,最大化分割包含大部分的数据点(x,y)。我们将用相同的iris数据集,展示用刚才的概念来进行花萼长度与花瓣宽度之间的线性拟合。相关的损失函数类似于max(0,|yi-(Axi+b)|-ε)。ε这里,是间隔宽度的一半,这意味着如果一个数据点在该区域,则损失等于0。...
2018-02-27 17:21:51 3343
原创 Tensorflow线性支持向量机的使用
本文将从iris数据集创建一个线性分类器。如前所述,用花萼宽度和花萼长度的特征可以创建一个线性二值分类器来预测是否为山鸢尾花。# Linear Support Vector Machine: Soft Margin# ----------------------------------## This function shows how to use TensorFlow to# cr...
2018-02-26 18:26:44 1147
原创 常用数学符号的LaTeX表示方法
行内公式单行公式(inline or displayed formulas)行内公式用单个$对,例如:$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$效果:∑ni=0i2=(n2+n)(2n+1)6∑i=0ni2=(n2+n)(2n+1)6\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}单行公式用$$,例如...
2018-02-26 16:20:24 5848
原创 用TensorFlow实现逻辑回归算法
本文将实现逻辑回归算法,预测低出生体重的概率。# Logistic Regression# 逻辑回归#----------------------------------## This function shows how to use TensorFlow to# solve logistic regression.# y = sigmoid(Ax + b)## We w...
2018-02-24 18:49:08 1803
原创 用TensorFlow实现弹性网络回归算法
弹性网络回归算法(Elastic Net Regression)是综合lasso回归和岭回归的一种回归算法,通过在损失函数中增加L1和L2正则项。本文使用多线性回归的方法实现弹性网络回归算法,以iris数据集为训练数据,用花瓣长度、花瓣宽度和花萼宽度三个特征预测花萼长度。# Elastic Net Regression# 弹性网络回归#-------------------------...
2018-02-24 17:03:25 2050 3
原创 用TensorFlow实现lasso回归和岭回归算法
也有些正则方法可以限制回归算法输出结果中系数的影响,其中最常用的两种正则方法是lasso回归和岭回归。lasso回归和岭回归算法跟常规线性回归算法极其相似,有一点不同的是,在公式中增加正则项来限制斜率(或者净斜率)。这样做的主要原因是限制特征对因变量的影响,通过增加一个依赖斜率A的损失函数实现。对于lasso回归算法,在损失函数上增加一项:斜率A的某个给定倍数。我们使用TensorFlow...
2018-02-24 16:46:30 2289
原创 用TensorFlow实现戴明回归算法
如果最小二乘线性回归算法最小化到回归直线的竖直距离(即,平行于y轴方向),则戴明回归最小化到回归直线的总距离(即,垂直于回归直线)。其最小化x值和y值两个方向的误差,具体的对比图如下图。 线性回归算法和戴明回归算法的区别。左边的线性回归最小化到回归直线的竖直距离;右边的戴明回归最小化到回归直线的总距离。线性回归算法的损失函数最小化竖直距离;而这里需要最小化总距离。给定直线的斜率和截距,则...
2018-02-24 16:31:26 1444
原创 改变损失函数和学习率来观察收敛性
改变损失函数和学习率来观察收敛性的变化。# Linear Regression: L1 vs L2# 改变损失函数和学习率来观察收敛性的变化#----------------------------------## This function shows how to use TensorFlow to# solve linear regression via the matri...
2018-02-24 14:36:22 7732
原创 用TensorFlow实现iris数据集线性回归
本文将遍历批量数据点并让TensorFlow更新斜率和y截距。这次将使用Scikit Learn的内建iris数据集。特别地,我们将用数据点(x值代表花瓣宽度,y值代表花瓣长度)找到最优直线。选择这两种特征是因为它们具有线性关系,在后续结果中将会看到。本文将使用L2正则损失函数。# 用TensorFlow实现线性回归算法#---------------------------------...
2018-02-24 11:59:57 2529
原创 用TensorFlow内建的Cholesky矩阵分解法实现矩阵分解的线性回归
用户对分解一个矩阵为多个矩阵的方法感兴趣的原因是,结果矩阵的特性使得其在应用中更高效。# 线性回归:矩阵分解法# 通过分解矩阵的方法求解有时更高效并且数值稳定#----------------------------------## This function shows how to use TensorFlow to# solve linear regression via ...
2018-02-24 11:08:22 1080
原创 Windows 10 64位下安装python2模块MySQLdb(MySQL-python)遇到的坑
开始在这儿下载了MSI安装包. 安装的时候需要python安装目录,配置信息在注册表里。 因为本地系统安装了两个版本的Python(2和3),手动修改的Python27安装目录。HKEY_CURRENT_USER\Software\Python\Pythoncore\2.7\InstallPath如果安装了一个版本的Python,可以使用Python脚本:# # ...
2018-02-23 13:39:23 1619
原创 用TensorFlow求逆矩阵和线性回归
线性回归算法能表示为矩阵计算,Ax=b。这里要解决的是用矩阵x来求解系数。注意,如果观测矩阵不是方阵,那求解出的矩阵x为x=(AT∗A)−1∗AT∗bx=(AT∗A)−1∗AT∗bx=(A^T*A)^{-1}*A^T*b。为了更直观地展示这种情况,我们将生成二维数据,用TensorFlow来求解,然后绘制最终结果。# 线性回归: 逆矩阵方法#-------------------------...
2018-02-06 20:06:41 1885
原创 TensorFlow实现模型评估
我们需要评估模型预测值来评估训练的好坏。 模型评估是非常重要的,随后的每个模型都有模型评估方式。使用TensorFlow时,需要把模型评估加入到计算图中,然后在模型训练完后调用模型评估。在训练模型过程中,模型评估能洞察模型算法,给出提示信息来调试、提高或者改变整个模型。但是在模型训练中并不是总需要模型评估,我们将展示如何在回归算法和分类算法中使用它。训练模型之后,需要定量评估模型的性能如
2018-02-06 11:02:06 7927
原创 TensorFlow实现创建分类器
创建一个iris数据集的分类器。 加载样本数据集,实现一个简单的二值分类器来预测一朵花是否为山鸢尾。iris数据集有三类花,但这里仅预测是否是山鸢尾。导入iris数据集和工具库,相应地对原数据集进行转换。# Combining Everything Together#----------------------------------# This file will perform bi
2018-02-05 16:02:00 1258
原创 TensorFlow实现随机训练和批量训练
TensorFlow更新模型变量。它能一次操作一个数据点,也可以一次操作大量数据。一个训练例子上的操作可能导致比较“古怪”的学习过程,但使用大批量的训练会造成计算成本昂贵。到底选用哪种训练类型对机器学习算法的收敛非常关键。 为了TensorFlow计算变量梯度来让反向传播工作,我们必须度量一个或者多个样本的损失。 随机训练会一次随机抽样训练数据和目标数据对完成训练。另外一个可选项是,一次大批量
2018-02-05 15:25:49 8122 3
原创 TensorFlow实现反向传播
使用TensorFlow的一个优势是,它可以维护操作状态和基于反向传播自动地更新模型变量。 TensorFlow通过计算图来更新变量和最小化损失函数来反向传播误差的。这步将通过声明优化函数(optimization function)来实现。一旦声明好优化函数,TensorFlow将通过它在所有的计算图中解决反向传播的项。当我们传入数据,最小化损失函数,TensorFlow会在计算图中根据状态相
2018-02-05 11:47:28 5019
原创 TensorFlow损失函数
损失函数(loss function)用来度量模型输出值与目标值(target)间的差值。# Loss Functions#----------------------------------## This python script illustrates the different# loss functions for regression and classificatio
2018-02-02 16:55:04 3485
原创 TensorFlow嵌入Layer-多个操作
import tensorflow as tfimport numpy as npsess = tf.Session()# 创建数据和占位符my_array = np.array([[1., 3., 5., 7., 9.], [-2., 0., 2., 4., 6.], [-6., -3., 0., 3.,
2018-02-02 16:51:58 599
原创 TensorFlow自定义Layer
import numpy as npimport tensorflow as tfimport osfrom tensorflow.python.framework import opsops.reset_default_graph()sess = tf.Session()x_shape = [1, 4, 4, 1]x_val = np.random.uniform(size=x
2018-02-02 16:49:52 3537
原创 Tensorflow图
import numpy as npimport tensorflow as tfimport osfrom tensorflow.python.framework import opsops.reset_default_graph()# 创建计算图sess = tf.Session()# 创建数据x_vals = np.array([1., 3., 5., 7., 9.])
2018-02-02 16:49:11 331
转载 MySql避免重复插入记录
方案一:使用ignore关键字如果是用主键primary或者唯一索引unique区分了记录的唯一性,避免重复插入记录可以使用:insert ignore into table_name(email,phone,user_id) values('test9@163.com','99999','9999'),这样当有重复记录就会忽略,执行后返回数字0,还有个应用就是复制表,避免重复记录
2018-02-02 14:14:07 2005
原创 Tensorflow安装(Ubuntu Python3.5)
安装环境Ubuntu 16.04.2 LTSPython 3.5.2选择版本仅支持CPU版本TensorflowGPU版本TensorFlow如果只是用来学习测试,建议安装第一个(CPU版本),此处用的这个版本。 产品线上就选第二个,毕竟性能更高一些,但是安装要稍微复杂一点。安装Python环境1.安装pip Virtualenv$ sud
2018-02-01 15:17:15 3143 1
安卓 RE文件浏览器,Root Explorer PRO Apk 4.10.3
2022-11-22
x64dbg-snapshot-2022-10-18-22-09
2022-10-28
ChromeDriver-92.0.4515.107.zip
2021-08-12
ChromeDriver-87.0.4280.88.rar
2020-12-14
带exp的pwn测试文件
2020-09-12
TraceMe.exe year.exe.rar
2020-09-12
flag.rar图片逆向排序
2020-09-09
coconut_tree.zip
2020-08-30
chromedriver_2.46.zip
2020-06-29
chromedriver_84.0.4147.30.zip
2020-06-29
Magisk-v20.4+MagiskManager-v7.5.0+Magisk-uninstaller-20200323.zip
2020-06-18
阿里巴巴新版Java开发手册.rar
2020-04-29
poppler-0.68.0_x86.7z
2019-10-25
quamotion-webdriver.0.123.3.win7-x64.zip
2019-08-15
selenium-server-standalone-3.141.59
2019-01-08
mozilla firfox geckodriver v0.23.0 火狐 webdriver
2018-11-20
ChromeDriver v2.44
2018-11-20
APK反编译工具apktool-dex2jar-luyten-jd-gui
2018-10-17
ChromeDriver 2.39 win32
2018-05-31
强化学习在阿里的技术演进与业务创新
2018-02-06
TensorFlow机器学习实战指南中英双语版-epub和pdf格式
2018-01-31
SVG精髓(第2版) (图灵程序设计丛书) 英文版
2017-10-26
Linear Algebra and Its Applications 5th Edition (David C. Lay)全书9-10章及所有答案
2017-10-25
网络安全思维导图
2017-09-19
《Windows程序设计》第五版 源码
2017-09-11
hanlp-portable-1.3.2.jar
2017-04-18
emmet PythonScript 打包压缩文件
2017-03-20
simplehtmldom
2014-05-12
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人