数据地址:链接: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):

这段代码演示了如何利用TensorFlow建立一个卷积神经网络模型,从CSV数据中读取GPS数据,然后预测区块车流量大小。模型包括卷积层、池化层和全连接层,最后进行预测并计算损失。数据来源于链接:https://pan.baidu.com/s/1KDPmGenKzOJ2nUoWPYFavw,密码:ir84。
最低0.47元/天 解锁文章
2051





