neural-networks-and-deep-learning misleading_gradient.py
来源:互联网 发布:手机淘宝标题模块 编辑:程序博客网 时间:2024/05/20 18:01
梯度下降
虽然纯看代码看不出来是干什么的,但是还是能学到一些语法的。
ax即
gca(self, **kwargs) method of matplotlib.figure.Figure instance Get the current axes, creating one if necessary
surf即在ax上绘制一个平面
ax.set_xlim3d就是各个维度的长度
ax.w_xaxis.set_major_locator就是设置显示几个坐标点来定位
ax.text就是在当前坐标系上的某个三维坐标中显示字符串的内容。
"""misleading_gradient~~~~~~~~~~~~~~~~~~~Plots a function which misleads the gradient descent algorithm."""#### Libraries# Third party librariesfrom matplotlib.ticker import LinearLocator# Note that axes3d is not explicitly used in the code, but is needed# to register the 3d plot type correctlyfrom mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as pltimport numpyfig = plt.figure()ax = fig.gca(projection='3d')X = numpy.arange(-1, 1, 0.025)Y = numpy.arange(-1, 1, 0.025)X, Y = numpy.meshgrid(X, Y)Z = X**2 + 10*Y**2colortuple = ('w', 'b')colors = numpy.empty(X.shape, dtype=str)for x in xrange(len(X)): for y in xrange(len(Y)): colors[x, y] = colortuple[(x + y) % 2]surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, facecolors=colors, linewidth=0)ax.set_xlim3d(-2, 2)ax.set_ylim3d(-2, 2)ax.set_zlim3d(0, 20)ax.w_xaxis.set_major_locator(LinearLocator(6))ax.w_yaxis.set_major_locator(LinearLocator(6))ax.w_zaxis.set_major_locator(LinearLocator(6))ax.text(0.05, -1.8, 0, "$w_1$", fontsize=20)ax.text(1.5, -0.25, 0, "$w_2$", fontsize=20)ax.text(1.79, 0, 9.62, "$C$", fontsize=20)plt.show()
0 0
- neural-networks-and-deep-learning misleading_gradient.py
- neural-networks-and-deep-learning mnist_pca.py
- neural-networks-and-deep-learning expand_mnist.py
- neural-networks-and-deep-learning mnist_average_darkness.py
- neural-networks-and-deep-learning mnist_svm.py
- neural-networks-and-deep-learning network.py
- neural-networks-and-deep-learning network2.py
- neural-networks-and-deep-learning test.py
- neural-networks-and-deep-learning network3.py
- neural-networks-and-deep-learning misleading_gradient_contours.py
- neural-networks-and-deep-learning backprop_magnitude_nabla.py
- neural-networks-and-deep-learning false_minimum.py
- neural-networks-and-deep-learning valley.py
- neural-networks-and-deep-learning valley2.py
- neural-networks-and-deep-learning weight_initialization.py
- neural-networks-and-deep-learning multiple_eta.py
- neural-networks-and-deep-learning more_data.py
- Neural Networks and Deep Learning
- 使用相册图片
- iOS开发中大部分App的网络数据交换是基于HTTP协议的。本文将简单介绍在Swift中使用HTTP进行网络请求的几种方法。
- TC入门
- 母函数 入门 + 模板
- Windows下从零开始学习nodejs4.X+express4.X开发--(1)nodejs安装
- neural-networks-and-deep-learning misleading_gradient.py
- JS框架
- eclipse 发布项目是报错 Publishing the configuration...
- c/c++编程题 之 猴子选大王(数组、链表两种方法)
- Spring 中数据源和数据库连接池配置的几种方法
- 指针与数组的区别
- Android SurfaceTexture和GLSurfaceView做Camera预览
- MFC类继承图与MFC颜色值对应表
- Java查找一个字符串中所有匹配某正则的子串