从0搭建一个线性回归的机器学习模型
线性回归是机器学习中的常见算法,前些日子一直在看相关的数学知识,这次决定在AI的帮助下,用python实现一次线性回归算法。这里用均方误差公式函数配合梯度下降法,试图拿下这个东西。 线性回归你的目的是找到一个形似y=wx+b的公式,w是权重,b是偏置。 第一步,先提供一个基础模板 1234567import numpy as npimport matplotlib.pyplot as plt#生成示例数据np.random.seed(1)x=np.random.rand(100,1)#生成目标值,同时加上一些噪声数据y=4*x+3+np.random.randn(100,1) 第二步,我们写一个类,实现线性回归 1234567891011121314151617181920212223242526class LinearRegression: def __init__(self, learning_rate=0.01, iterations=1000): self.learning_rate = learning_rate ...
angr学习
angr符号执行框架,是我一直想要理解学习的,今天就来实际学习体验一下。 根据网上教的,应该是在GitHub - jakespringer/angr_ctf 网站上面下载对应的习题,编写对应的python进行练习。 前置要求:安装angr库,我已经满足,接下来就开始进行捣鼓。 angr的原理我也不太能解释清楚,所以直接开干吧。(默认python代码均引入angr库) 因此,使用 angr 一般分为如下步骤: 创建 Project,预设 state 创建位向量和符号变量,保存在内存/寄存器/文件或其他地方(简单的题目直接可以省略) 将 state 添加到 SM 中 运行,探索满足条件的路径 约束求解获取执行结果 1-angr-find用这个作为入门吧。分析一下代码: 1234567891011121314151617int __cdecl main(int argc, const char **argv, const char **envp){ int i; // [esp+1Ch] [ebp-1Ch] char s1[9]; //...
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1$ hexo new "My New Post" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info:...