自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 收藏
  • 关注

原创 常用的激活函数

#activation function import numpy as np import matplotlib.pyplot as plt import tensorflow as tf x = np.linsoace(-7,7,180) def sigmoid(inputs): y = [ 1 / float(1 + np.exp(-x)) for x in inputs ] re...

2018-03-22 11:01:39 218

原创 梯度下降

梯度下降算是机器学习的核心优化算法了。tensorflow的运算操作import numpy as numpy import matplotlib.pyplot as plt import tensorflow as tf #构建数据 points_num = 100 vectors = [] for i in xrange(points_num): x1 = np.random.normal...

2018-03-21 22:41:17 150

原创 matplotlib的使用

import matplotlib.pyplot as plt import numpy as np x = np.linspace(-4,4,50) y1 = x * 2 +1 y2 = x*x + 10 #创建第一张图表 #plot,画线 #figsize:生成图的初始大小 plt.figure(num=1,figsize=(7,6)) plt.plot(x,y1) plt.plot(x,...

2018-03-21 21:37:58 126

原创 TensorBoard的运用

使用方式:1、用TensorFlow保存图的信息到日志中tf.summary.FileWriter("路径",sess.graph)2、用TensorBoard读取并展示日志tensorboard --logdir=路径TensorBoard图标:eg:tensorboard --logdir=/tmp/hello(要注意的是,浏览器会使用6006端口)import tensorflow as t...

2018-03-21 20:40:12 219

原创 Graph和Session的小案例

import tensorflow as tf #创建一个常量 c = tf.constant( [[2,3],[4,5]],name="const1",dtype=int64 ) #输出c:<tf.Tensor 'const1:0' shape=(2,2) dtype=int64> #创建会话,需要关闭 sess = tf.Session() sess.run(c) ''' ...

2018-03-21 17:12:32 203

原创 TensorFlow常用库NumPy

官网教程:https://docs.scipy.org/doc/numpy-dev/user/quickstart.html首先要注意一句话:NumPy’s main object is the homogeneous multidimensional array翻译过来就是,numpy库的主要对象是多维数组,0、1、2、3.....特征:ndarray.ndim:该对象的维度ndarray.sh...

2018-03-21 13:11:23 492

原创 HelloWorld

使用tensorflow库写helloWorldimport tensorflow as tf #创建一个常量 hw = tf.constant("Hello World") #启动一个TensorFlow的session sess = tf.Session() #运行 Graph print sess.run(hw) #关闭 Session sess.close()运行后,将会显示一句话...

2018-03-21 12:39:17 108

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除