创建一个NNimporttensorflowastfimportnumpyasnp#fakedatax=np.linspace(-1,1,100)[:,np.newaxis]#shape(100,1)noise=np.random.normal(0,0.1,size=x.shape)y=np.power(x,2)+noise#shape(100,1)+noisetf_x=tf.placeholder(tf.float32,x.shape)#inputxtf_y=tf.placeholder(tf.float32,y.shape)#outputyl=tf.layers.dense(tf_x,10,tf.nn.relu)#hiddenlayero=tf.layers.dense(l,1)...
继续阅读 >