- 博客(9)
- 收藏
- 关注
转载 TensorFlow CNN
简单的分类任务 import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('data/', one_hot=True) # to be able to rerun the model without overwritin...
2019-07-03 16:25:53 100
转载 Tensorflow with Hidden Layers
简单的只有一层隐藏层 import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('data/', one_hot=True) num_classes = 10 batch_size = 64 hidden_units =...
2019-07-02 22:37:31 196
转载 Tensorflow Logistic
写代码真的要小心的,小问题调试半天。。。 import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('data/', one_hot=True) num_classes = 10 input_size = 784 tra...
2019-07-01 23:42:05 111
转载 Tensorflow Mnist数据集
Tensorflow自带的Mnist数据集相关情况 import tensorflow as tf import numpy as np import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data #数据会自动在线下载,第一次较慢,第二次之后就好了 mnist = input_...
2019-07-01 18:16:19 97
转载 Tensorflow LinearR
构造数据,实现简单的线性回归 import tensorflow as tf import matplotlib.pyplot as plt import numpy as np #模拟数据 num_points = 1000 vec_points = [] for i in range(num_points): x = np.random.normal(0.0,0.5) y ...
2019-07-01 17:33:57 161
转载 Tensorflow Placeholder
Placeholder可以用来取数据 import tensorflow as tf input_1 = tf.placeholder(tf.float32)#先把坑占了,不用提前指定具体值 input_2 = tf.placeholder(tf.float32)#比如每个batch output_op = tf.multiply(input_1,input_2) with tf.Sessi...
2019-07-01 00:12:57 78
转载 Numpy to Tensor
numpy数据转成Tensor小Demo import numpy as np import tensorflow as tf temp_np = np.zeros((3,3)) print(type(temp_np))#<class 'numpy.ndarray'> tensor_temp = tf.convert_to_tensor(temp_np)#<class 'ten...
2019-06-30 23:54:23 438
转载 Tensorflow Variable&Constant
tensorflow变量定义和赋值没有python那么简单,需要在session中run才能拿到结果 import tensorflow as tf w = tf.Variable([[1.0,2.0]]) print(w)#<tf.Variable 'Variable:0' shape=(1, 2) dtype=float32_ref> x = tf.Variable([[1.0]...
2019-06-30 23:17:38 169
转载 Tensorflow环境安装配置
tensorflow的环境配置主要分为两步: anaconda安装和配置 tensorflow包下载和安装在命令行输入: conda install tensorflow 然后就可以开始写tensorflow小程序了
2019-06-30 22:38:14 120
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人