tensorflow
该用户没有用户名
爱好学习,多多交流。
展开
-
3.1.逻辑回归实战
import numpy as npimport matplotlib.pyplot as pltnp.random.seed(0)Num = 100 #共100个点# X(x1,x2) y 0/1# y = 1x_1 = np.random.normal(6,1,size=(Num))#6是中心点,1是方差x_2 = np.random.normal(3,1,size=(Nu...原创 2020-05-04 18:24:40 · 258 阅读 · 0 评论 -
3.2.softmax实战
# X(x1,x2) y(0/1/2/3)import numpy as npimport matplotlib.pyplot as pltnp.random.seed(0)Num = 100x_1 = np.random.normal(-3,1,size=(Num))x_2 = np.random.normal(-3,1,size=(Num))y = np.zeros(Nu...原创 2020-05-04 18:24:04 · 228 阅读 · 0 评论 -
2.基于感知机的二分类问题
import numpy as npimport matplotlib.pyplot as pltnp.random.seed(0)Num = 100x_1 = np.random.normal(6,1,size=(Num))x_2 = np.random.normal(3,1,size=(Num))y = np.ones(Num)*-1c_0 = np.array([x_1,...原创 2020-05-04 18:22:43 · 820 阅读 · 0 评论 -
1.5.最小二乘法求二元线性回归
最小二乘法求二元线性回归y=2x1+(−3)∗x2+4y=2x_{1}+(-3)*x_{2}+4y=2x1+(−3)∗x2+4构造数据集import numpy as npnp.random.seed(1)X = np.random.normal(size=(1000,2),scale=1)#1000行2列,每个样本有一个特征Xarray([[ 1.62434536, -0...原创 2020-05-04 18:22:03 · 3106 阅读 · 0 评论 -
1.4最小二乘法求一元线性回归
最小二乘法求一元线性回归y=4x+2构造数据集import numpy as npnp.random.seed(0)X = np.random.normal(size=(100,1),scale=1)#100行1列,每个样本有一个特征y=4*X[:,0]+2import matplotlib.pyplot as pltplt.scatter(X,y)<matplo...原创 2020-05-04 18:19:57 · 225 阅读 · 0 评论 -
1.3.随机梯度下降法实战
随机梯度下降法实战1.构建数据集y = 2 * ximport numpy as npX = np.arange(0,50)Xarray([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,...原创 2020-05-04 18:17:41 · 219 阅读 · 0 评论 -
1.2Numpy实战
import numpy as np1.Numpy的数组类型array = [1,2,3,4,5]array[1, 2, 3, 4, 5]type(array)listarray+1---------------------------------------------------------------------------TypeError ...原创 2020-05-04 18:11:54 · 149 阅读 · 0 评论 -
1.tf.keras.线性回归
tensorflow学习:tf.keras.线性回归import tensorflow as tfprint('Tensorflow Version: {}'.format(tf.__version__))import pandas as pdimport matplotlib.pyplot as pltimport numpy as npdata = pd.read_csv('./...原创 2020-04-26 00:20:57 · 159 阅读 · 0 评论 -
2.多层感知机(神经网络)
Tensorflow:多层感知机(神经网络)import tensorflow as tfprint('Tensorflow Version: {}'.format(tf.__version__))import syssys.path.append('D:/Anaconda/Lib/site-packages/')import pandas as pdimport numpy as...原创 2020-04-26 00:16:26 · 145 阅读 · 0 评论