='Y') return X,Y X,Y=create_placeholder(64,3,6) print("X="+str(X)) print("Y="+str(Y)) def weight_variable(shape): return tf.Variable(tf.truncated_normal(shape,stddev=0.1)) def bias_variable(shape): return tf.Variable(tf.constant(0.1,shape=shape)) def conv2d(x,W): return tf.nn.conv2d(x,W,strides=[1,1,1,1],padding='SAME') def max_pool_2x2(x): return tf.nn.max_pool(x,ksize=[1,2,2,1],strides=[1,2,2,1],padding='SAME') def initialize_parameters(): w_conv1=weight_variable([5,5,3,32]) b_conv1=bias_variable([32]) w_conv2=weight_variable([5,5,32,64]) b_conv2=bias_variable([64]) w_fc1=weight_variable([16*16*64,512]) b_fc1=bias_variable([512]) w_fc2=weight_variable([512,6]) b_fc2=bias_variable([6]) parameters={ "w_conv1":w_conv1, "b_conv1":b_conv1, "w_conv2":w_conv2, "b_conv2":b_conv2, "w_fc1":w_fc1, "b_fc1":b_fc1, "w_fc2":w_fc2, "b_fc2":b_fc2 } return parameters 第四步:前行传播过程
- def forward_propagation(X,parameters):
- w_conv1=parameters["w_conv1"]
- b_conv1=parameters["b_conv1"]
- h_conv1=tf.nn.relu(conv2d(X,w_conv1)+b_conv1)
- h_pool1=max_pool_2x2(h_conv1)
-
- w_conv2=parameters["w_conv2"]
- b_conv2=parameters["b_conv2"
推荐阅读
区块链分叉是怎么回事儿?终于懂了
Tech Neo技巧沙龙 | 11月25号,九州云/ZStack与您一路商量云时代收集界线治理实践
最终,只有一条链会被保存下>>>详细阅读
本文标题:深入浅出解读卷积神经网络
地址:http://www.17bianji.com/lsqh/39218.html
1/2 1