- 博客(9)
- 收藏
- 关注
原创 TF Cookbook 使用多层神经网络
import matplotlib.pyplot as plt import numpy as np import csv import tensorflow as tf sess=tf.Session() birth_weight_file = 'birth.csv' birth_data = [] with open(birth_weight_file, newline='') as cs...
2019-10-31 07:45:35 71
原创 TF Cookbook 单层神经网络
import matplotlib.pyplot as plt import numpy as np import tensorflow as tf # 重置计算图会话 tf.reset_default_graph() sess=tf.Session() # 初始化输入数组为10X10的矩阵,然后初始化计算图的占位符 data_size=[10,10] data_2d=np.random.norm...
2019-10-29 07:55:04 74
原创 TF-cookbook c3求解矩阵参数
import matplotlib.pyplot as plt import numpy as np import tensorflow as tf # 1.初始化计算图,生成数据 sess=tf.Session() x_vals=np.linspace(0,10,100) y_vals=x_vals+np.random.normal(0,1,100) # 2.求逆方法所需的矩阵 x_vals_...
2019-08-29 16:34:44 207
原创 TF-cookbook4模型建立
# 模型评估需要一个训练数据集,一个测试数据集,有时还需要一个验证数据集 # 回归算法模型用来预测连续数值型,其目标是数字,为了评估回归预测值是否与实际目标相符合,需要度量两者之间的距离 # t1:评估简单的回归算法模型,拟合常数乘法,目标值为10 # 1.创建计算图,数据集,变量和占位符,然后将其分割为训练数据集和测试数据集,在训练数据集和测试数据集上都进行模型评估,以确定是否过拟合 impor...
2019-08-23 16:14:37 98
原创 TF-cookbook c2创建分类器
import matplotlib.pyplot as plt import numpy as np from sklearn import datasets import tensorflow as tf sess=tf.Session() iris=datasets.load_iris() # print(iris.target) # print(iris.keys,iris.values...
2019-08-23 10:36:27 114
原创 TF-cookbook c2 反向传播
import numpy as np import tensorflow as tf sess=tf.Session() # 生成数据,创建占位符 x_vals=np.random.normal(1,0.1,100) y_vals=np.repeat(10.,100) x_data=tf.placeholder(shape=[1],dtype=tf.float32) y_target=tf.pla...
2019-08-19 15:24:04 105
转载 转 TensorFlow学习笔记——节点(constant、placeholder、Variable)
TensorFlow学习笔记——节点(constant、placeholder、Variable) 一、 constant(常量) constant是TensorFlow的常量节点,通过constant方法创建,其是计算图(Computational Graph)中的起始节点,是传入数据。 创建方式 cons = tf.constant(value=[1,2],dtype=tf.float32,s...
2019-08-01 13:47:02 268
原创 tensorflow学习笔记一
import tensorflow as tf import numpy as np a=tf.placeholder(tf.int32,shape=[2],name=‘my_input’) b=tf.reduce_prod(a,name=‘prod_b’) c=tf.reduce_sum(a,name=‘sum_c’) d=tf.add(b,c,name=‘add_d’) with tf.Ses...
2019-07-24 11:23:09 218
原创 tensorboard windows环境No graph definition files were found解决
初开始用tensorboard,出现No graph definition files were found,后来发现是使用pip install tensorboard后,logs文件夹出现的位置没找到, 随后 改下输入完整的路径就好了,路径是在包含events.out.***的logs ...
2019-07-22 15:03:39 257
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人