数据地址:链接:https://pan.baidu.com/s/1KDPmGenKzOJ2nUoWPYFavw 密码:ir84
import numpy as np
import csv
import tensorflow as tf
url = "/home/enche/test/test.csv"
data = csv.reader(open(url))
x_ = []
y_ = []
for i in data:
sum = 0
for j in range(len(i)):
i[j] = np.float32(i[j])
sum += i[j]
for j in range(len(i)):
if(j<len(i)-1):
x_.append(np.float32(i[j])/sum)
else:
y_.append(np.float32(i[j]))
def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1)
return tf.Variable(initial)
def bias_variable(shape):
initial = tf.constant(0.1, shape=shape)
return tf.Variable(initial)
def conv2d(x, W):
return tf.nn.conv2d(x, W, strides