#NEWLINE# def dnn( x ) : #NEWLINE# #INDENT# with tf . name_scope ( 'Layer1' ) : #NEWLINE# #INDENT# W1 = tf . Variable ( tf . random_normal ( [ 784 , 256 ] ) , name = 'W1' ) #NEWLINE# b1 = tf . Variable ( tf . random_normal ( [ 256 ] ) , name = 'b1' ) #NEWLINE# x = tf . nn . tanh ( tf . add ( tf . matmul ( x , W1 ) , b1 ) ) #NEWLINE# tf . add_to_collection ( tf . GraphKeys . ACTIVATIONS , x ) #NEWLINE# tflearn . add_weights_regularizer ( W1 , 'L2' , weight_decay = 0.001 ) #NEWLINE# #UNINDENT# with tf . name_scope ( 'Layer2' ) : #NEWLINE# #INDENT# W2 = tf . Variable ( tf . random_normal ( [ 256 , 256 ] ) , name = 'W2' ) #NEWLINE# b2 = tf . Variable ( tf . random_normal ( [ 256 ] ) , name = 'b2' ) #NEWLINE# x = tf . nn . tanh ( tf . add ( tf . matmul ( x , W2 ) , b2 ) ) #NEWLINE# tf . add_to_collection ( tf . GraphKeys . ACTIVATIONS , x ) #NEWLINE# tflearn . add_weights_regularizer ( W2 , 'L2' , weight_decay = 0.001 ) #NEWLINE# #UNINDENT# with tf . name_scope ( 'Layer3' ) : #NEWLINE# #INDENT# W3 = tf . Variable ( tf . random_normal ( [ 256 , 10 ] ) , name = 'W3' ) #NEWLINE# b3 = tf . Variable ( tf . random_normal ( [ 10 ] ) , name = 'b3' ) #NEWLINE# x = tf . add ( tf . matmul ( x , W3 ) , b3 ) #NEWLINE# #UNINDENT# return x