009-lab-001. xor by none nn,xor by nn,wide and deep nn @ lab-09-1-xor.py import tensorflow as tf import numpy as np tf.set_random_seed(777) learning_rate=0.1 x_train_data_list=[[0,0], [0,1], [1,0], [1,1]] y_train_data_list=[[0], [1], [1], [0]] x_train_data=np.array(x_train_data_list,dtype=np.float32) y_train_data=np.array(y_train_data_list,dtype=np.float32) # [n,2] X_placeholder_node=tf.placeholder(tf.float32,[None,2]) # [n,1] Y_placeholder_node=tf.placeholder(tf.float32,[None,1]) # [n,2][?,?]=[n,1] # [?,?]=[2,1] W_variable_node=tf.Variable(tf.random_normal([2,1]),name='weight') b_variable_node=tf.Variable(tf.random_normal([1]),name='bias') # tf.div(1.,1. + tf.exp(tf.matmul(X_placeholder_node,W_variable_node))) hypothesis_f_sigmoid_node\ =tf.sigmoid(tf.matmul(X_placeholder_node,W_variable_node)+b_variable_node) cost_f_cross_entropy_node\ =-tf.reduce_mean(Y_placeholder_node*tf.log(hypothesis_f_sigmoid_node)+(1-Y_placeholder_node)*tf.log(1-hypothesis_f_sigmoid_node)) to_be_trained_node=tf.train.GradientDescentOptimizer(learning_rate=learning_rate).minimize(cost_f_cross_entropy_node) prediction_casted_to_0_or_1_node\ =tf.cast(hypothesis_f_sigmoid_node>0.5,dtype=tf.float32) accuracy_node\ =tf.reduce_mean(tf.cast(tf.equal(prediction_casted_to_0_or_1_node,Y_placeholder_node),dtype=tf.float32)) with tf.Session() as sess_object: sess_object.run(tf.global_variables_initializer()) for step in range(10001): sess_object.run(to_be_trained_node\ ,feed_dict={X_placeholder_node:x_train_data,Y_placeholder_node:y_train_data}) if step%1000==0: print("step:",step,"cost:",sess_object.run(cost_f_cross_entropy_node,feed_dict={X_placeholder_node:x_train_data,Y_placeholder_node:y_train_data}),"weight:",sess_object.run(W_variable_node)) hypo,cost,accu=sess_object.run([hypothesis_f_sigmoid_node,prediction_casted_to_0_or_1_node,accuracy_node],feed_dict={X_placeholder_node:x_train_data,Y_placeholder_node:y_train_data}) print("\nHypothesis:\n",hypo,"\nCorrect:\n",cost,"\nAccuracy:\n",accu) # @ # lab-09-2-xor-nn.py import tensorflow as tf import numpy as np tf.set_random_seed(777) learning_rate=0.1 x_train_data_list=[[0,0], [0,1], [1,0], [1,1]] y_train_data_list=[[0], [1], [1], [0]] x_train_data=np.array(x_train_data_list,dtype=np.float32) y_train_data=np.array(y_train_data_list,dtype=np.float32) # [n,2] X_placeholder_node=tf.placeholder(tf.float32,[None,2]) # [n,1] Y_placeholder_node=tf.placeholder(tf.float32,[None,1]) # XW=H(X_placeholder_node) # Number of output(output of layer1) can be determined by your random choice # I like it to be 2 # [n,2][?,?]=[n,2] # [?,?]=[2,2] W1_variable_node=tf.Variable(tf.random_normal([2,2]),name='weight1') b1_variable_node=tf.Variable(tf.random_normal([2]),name='bias1') # Output is layer1 layer1=tf.sigmoid(tf.matmul(X_placeholder_node,W1_variable_node)+b1_variable_node) # layer1 output(input of layer2): [n,2] # Output is fixed as [n,1] # y_train_data=[[0], # [1], # [1], # [0]] # [n,2][?,?]=[n,1] # [?,?]=[2,1] W2_variable_node=tf.Variable(tf.random_normal([2,1]),name='weight2') b2_variable_node=tf.Variable(tf.random_normal([1]),name='bias2') # Input is layer1 hypothesis_f_sigmoid_node=tf.sigmoid(tf.matmul(layer1,W2_variable_node)+b2_variable_node) cost_f_cross_entropy_node\ =-tf.reduce_mean(Y_placeholder_node*tf.log(hypothesis_f_sigmoid_node)+(1-Y_placeholder_node)*tf.log(1-hypothesis_f_sigmoid_node)) to_be_trained_node\ =tf.train.GradientDescentOptimizer(learning_rate=learning_rate).minimize(cost_f_cross_entropy_node) prediction_casted_to_0_or_1_node\ =tf.cast(hypothesis_f_sigmoid_node > 0.5,dtype=tf.float32) accuracy_node\ =tf.reduce_mean(tf.cast(tf.equal(prediction_casted_to_0_or_1_node,Y_placeholder_node),dtype=tf.float32)) with tf.Session() as sess_object: sess_object.run(tf.global_variables_initializer()) for step in range(10001): sess_object.run(train,feed_dict={X_placeholder_node: x_train_data,Y_placeholder_node: y_train_data}) if step%1000==0: print(step,sess_object.run(cost_f_cross_entropy_node,feed_dict={ X_placeholder_node:x_train_data,Y_placeholder_node:y_train_data}),sess_object.run([W1_variable_node,W2_variable_node])) h,c,a=sess_object.run([hypothesis_f_sigmoid_node,prediction_casted_to_0_or_1_node,accuracy_node], feed_dict={X_placeholder_node: x_train_data,Y_placeholder_node: y_train_data}) print("\nHypothesis: ",h,"\nCorrect: ",c,"\nAccuracy: ",a) # @ # lab-09-3-xor-nn-wide-deep.py import tensorflow as tf import numpy as np tf.set_random_seed(777) learning_rate=0.1 x_train_data_list=[[0,0], [0,1], [1,0], [1,1]] y_train_data_list=[[0], [1], [1], [0]] x_train_data=np.array(x_train_data_list,dtype=np.float32) y_train_data=np.array(y_train_data_list,dtype=np.float32) X_placeholder_node=tf.placeholder(tf.float32,[None,2]) Y_placeholder_node=tf.placeholder(tf.float32,[None,1]) # Input is fixed as [n,2] # Output of layer1(input of layer2) can be determined, # by your arbitary choice [n,10] # [n,2][?,?]=[n,10],[?,?]=[2,10] W1_variable_node=tf.Variable(tf.random_normal([2,10]),name='weight1') b1_variable_node=tf.Variable(tf.random_normal([10]),name='bias1') layer1=tf.sigmoid(tf.matmul(X_placeholder_node,W1_variable_node)+b1_variable_node) # [n,10][?,?]=[n,10],[?,?]=[10,10] W2_variable_node=tf.Variable(tf.random_normal([10,10]),name='weight2') b2_variable_node=tf.Variable(tf.random_normal([10]),name='bias2') layer2=tf.sigmoid(tf.matmul(layer1,W2_variable_node) + b2_variable_node) # [n,10][?,?]=[n,10],[?,?]=[10,10] W3_variable_node=tf.Variable(tf.random_normal([10,10]),name='weight3') b3_variable_node=tf.Variable(tf.random_normal([10]),name='bias3') layer3=tf.sigmoid(tf.matmul(layer2,W3_variable_node)+b3_variable_node) # [n,10][?,?]=[n,1],[?,?]=[10,1] W4_variable_node=tf.Variable(tf.random_normal([10,1]),name='weight4') b4_variable_node=tf.Variable(tf.random_normal([1]),name='bias4') hypothesis_f_sigmoid_node=tf.sigmoid(tf.matmul(layer3,W4_variable_node)+b4_variable_node) cost_f_cross_entropy_node\ =-tf.reduce_mean(Y_placeholder_node*tf.log(hypothesis_f_sigmoid_node)+(1-Y_placeholder_node)*tf.log(1-hypothesis_f_sigmoid_node)) to_be_trained_node\ =tf.train.GradientDescentOptimizer(learning_rate=0.1).minimize(cost_f_cross_entropy_node) prediction_casted_to_0_or_1_node\ =tf.cast(hypothesis_f_sigmoid_node > 0.5,dtype=tf.float32) accuracy_node\ =tf.reduce_mean(tf.cast(tf.equal(prediction_casted_to_0_or_1_node,Y_placeholder_node),dtype=tf.float32)) with tf.Session() as sess_object: sess_object.run(tf.global_variables_initializer()) for step in range(10001): sess_object.run(to_be_trained_node,feed_dict={X_placeholder_node:x_train_data,Y_placeholder_node:y_train_data}) if step%1000==0: print(step,sess_object.run(cost_f_cross_entropy_node,feed_dict={ X_placeholder_node:x_train_data,Y_placeholder_node:y_train_data}),sess_object.run([W1_variable_node,W2_variable_node])) h,c,a=sess_object.run([hypothesis_f_sigmoid_node,prediction_casted_to_0_or_1_node,accuracy_node], feed_dict={X_placeholder_node:x_train_data,Y_placeholder_node:y_train_data}) print("\nHypothesis: ",h,"\nCorrect: ",c,"\nAccuracy: ",a) # 0 0.7161747 [array([[ 0.8027591 , 0.6786782 , -1.2173089 , -0.30514258, -0.3031212 , # 1.508206 , 0.75801593, -0.7008277 , -2.108215 , 0.66519433], # [ 0.3948534 , 2.0836844 , -0.5985832 , 0.7152209 , 1.112964 , # 0.5976397 , -0.90518147, -0.7187707 , -0.01691372, -0.7054908 ]], # dtype=float32), array([[ 1.3856996 , -0.78354955, -0.6576518 , -1.1425122 , -0.12848108, # 1.6673336 , -0.4395559 , -0.56968033, 2.8857622 , -1.7442085 ], # [ 0.59582925, -0.6563187 , -0.3696238 , -0.8523011 , 1.2597212 , # -0.317311 , 0.7776276 , 0.5716108 , -0.63506633, -0.8573337 ], # [ 1.8891892 , 1.1163192 , 1.7418191 , 1.1878847 , -1.8119913 , # 1.0620166 , 0.8971168 , 1.87823 , -0.45331135, -0.1719603 ], # [ 1.9701065 , 0.873873 , -0.03704182, -1.6959451 , -0.68172455, # 1.1073123 , -0.09139533, -1.0658412 , 0.93695635, -1.328567 ], # [-0.21568462, -0.3971281 , -0.4340308 , 0.30262947, 0.0121125 , # 0.41759133, -0.2008016 , -0.990839 , 0.33389005, 0.9672624 ], # [-0.65031695, 1.7800586 , -1.0042317 , 0.03137555, -0.25964364, # 1.7073264 , -0.5583125 , 0.35878345, -0.1393799 , 0.86651736], # [ 1.3122758 , -2.2639499 , -0.4375475 , -0.4657622 , -0.37226892, # 1.6425537 , -1.4994388 , 0.9467619 , -1.0728635 , 0.27397364], # [ 1.0020316 , -1.3980633 , 0.3369874 , 1.1782864 , 0.12569395, # 1.7209738 , 0.72182983, -0.6681288 , 1.6562439 , 0.643704 ], # [-0.35086328, 0.22173518, -0.6438379 , 2.0791771 , 1.9243479 , # -0.25757402, 0.4861589 , -3.4291756 , -0.8836606 , 1.4579748 ], # [-0.01154758, -1.0056453 , -0.3976467 , 1.5964891 , 0.37146357, # 0.7998121 , 0.28965023, -1.5488534 , -1.1742102 , -1.6740421 ]], # dtype=float32)] # 1000 0.6471139 [array([[ 1.1973518 , 0.96586126, -1.3085446 , -0.34166726, -0.30726942, # 1.5750766 , 1.2913494 , -0.7604257 , -2.114052 , 0.81177944], # [ 0.63390017, 2.2167568 , -0.65307266, 0.94966143, 0.9831414 , # 1.0358512 , -0.83872205, -0.9728932 , 0.0759084 , -0.4960237 ]], # dtype=float32), array([[ 1.2339919 , -0.7140585 , -0.64505005, -1.0158627 , -0.09627357, # 1.6676489 , -0.51223963, -0.5773235 , 2.9145977 , -1.9368798 ], # [ 0.45872113, -0.47732016, -0.5249053 , -0.798672 , 1.2923471 , # -0.31233913, 0.77768415, 0.58063674, -0.6621644 , -1.2747316 ], # [ 1.9286984 , 1.1047271 , 1.8397605 , 1.1732696 , -1.8505548 , # 1.0608925 , 0.85555923, 1.8788676 , -0.49131036, -0.03942462], # [ 1.9333273 , 1.0206048 , 0.01187088, -1.6662577 , -0.71567565, # 1.1087427 , -0.12491434, -1.0614007 , 0.88724345, -1.3754933 ], # [-0.24706155, -0.2432646 , -0.3733783 , 0.32466015, -0.03422378, # 0.4194336 , -0.25219953, -0.9836832 , 0.2576718 , 0.9121726 ], # [-0.8779695 , 1.9124665 , -1.0805314 , 0.20772901, -0.18199246, # 1.7088014 , -0.58852535, 0.34782326, -0.05442519, 0.5247391 ], # [ 1.2317162 , -2.3906085 , -0.3180836 , -0.36170578, -0.35016012, # 1.6392182 , -1.609551 , 0.9318443 , -1.031561 , 0.308731 ], # [ 1.0491114 , -1.4174937 , 0.533731 , 1.1835903 , 0.06363987, # 1.718343 , 0.6376954 , -0.67111886, 1.6089866 , 0.8915427 ], # [-0.34790623, 0.2956913 , -0.58035505, 2.090802 , 1.8964255 , # -0.2577226 , 0.475237 , -3.4290326 , -0.9010771 , 1.5273477 ], # [-0.07711979, -1.0732929 , -0.2140166 , 1.6932302 , 0.35761622, # 0.7965091 , 0.14382075, -1.5606378 , -1.1765721 , -1.5811757 ]], # dtype=float32)] # 2000 0.11451591 [array([[ 1.8863931 , 1.2045985 , -1.7805133 , -0.23970667, -0.5156318 , # 2.631488 , 3.1535459 , -1.4656006 , -2.2259705 , 1.2520137 ], # [ 0.7584833 , 2.3509703 , -0.96953577, 2.6744058 , 0.59355074, # 2.2985487 , -1.9456444 , -1.5707902 , 0.5577288 , -0.6701635 ]], # dtype=float32), array([[ 0.6584844 , -1.0036675 , -0.88756436, -0.9892244 , -0.09301384, # 1.6697972 , -0.56722087, -0.586124 , 2.8743775 , -2.4953938 ], # [ 0.7818078 , -0.5264434 , -0.74963397, -1.0833097 , 1.1710205 , # -0.30800712, 0.71295667, 0.59614366, -0.9387747 , -2.000873 ], # [ 2.0644553 , 1.1086677 , 2.0487247 , 1.2009186 , -1.9084177 , # 1.0599008 , 0.83371633, 1.8807697 , -0.5562479 , 0.25521263], # [ 2.755643 , 1.1394832 , 0.16832046, -1.951145 , -0.9397455 , # 1.110926 , -0.1991683 , -1.0402592 , 0.52489763, -1.4922087 ], # [-0.12650858, -0.04866919, -0.2034472 , 0.31059673, -0.16539177, # 0.42073923, -0.3090509 , -0.9724138 , 0.05691924, 0.97445935], # [-2.3547919 , 2.1686978 , -1.4945363 , 0.5589278 , -0.0969204 , # 1.7128385 , -0.60810035, 0.33164662, 0.0818845 , -0.16668823], # [ 1.2196429 , -3.4394524 , -0.09725072, -0.40026715, -0.43791407, # 1.6367915 , -1.7223908 , 0.9179181 , -1.2008321 , 0.41484985], # [ 1.1131049 , -1.4700465 , 0.89904046, 1.2889564 , -0.01465004, # 1.7161475 , 0.59913385, -0.67336774, 1.5400223 , 1.438034 ], # [-0.51993364, 0.59953004, -0.4906261 , 2.2139242 , 1.8736949 , # -0.2574501 , 0.47524798, -3.4279025 , -0.89610416, 1.6868163 ], # [-0.7491028 , -1.5129242 , -0.17663532, 1.8680296 , 0.3474756 , # 0.7959364 , 0.07285845, -1.5763088 , -1.1912522 , -1.6277317 ]], # dtype=float32)] # 3000 0.014267718 [array([[ 2.0770237 , 1.2012119 , -1.9488829 , -0.41913015, -0.60279465, # 3.0199163 , 3.6171784 , -1.6602551 , -2.3629415 , 1.205118 ], # [ 0.78998184, 2.3717792 , -1.1272202 , 3.2393522 , 0.50956815, # 2.7011871 , -2.3483021 , -1.7195398 , 0.8864371 , -0.83012706]], # dtype=float32), array([[ 5.9311074e-01, -1.1358490e+00, -9.7212642e-01, -1.0526367e+00, # -1.3918819e-01, 1.6705270e+00, -5.7342982e-01, -5.8357185e-01, # 2.8536501e+00, -2.6757398e+00], # [ 1.1497831e+00, -6.2010485e-01, -7.6554990e-01, -1.3002330e+00, # 1.0342360e+00, -3.0711114e-01, 6.9388688e-01, 6.0286248e-01, # -1.0536392e+00, -2.1550312e+00], # [ 2.1591702e+00, 1.1146585e+00, 2.1143260e+00, 1.2367934e+00, # -1.9287769e+00, 1.0597996e+00, 8.3021683e-01, 1.8818535e+00, # -5.7563502e-01, 3.4286293e-01], # [ 3.1997681e+00, 1.1402589e+00, 1.9481264e-01, -2.1181836e+00, # -1.1082852e+00, 1.1121019e+00, -2.2177090e-01, -1.0315326e+00, # 3.9234903e-01, -1.5917668e+00], # [-1.1397918e-01, 4.2033833e-03, -1.8395111e-01, 3.8105053e-01, # -2.1357985e-01, 4.2134878e-01, -3.1464377e-01, -9.6929532e-01, # 3.7523083e-02, 9.7965038e-01], # [-2.9213417e+00, 2.2276082e+00, -1.6808766e+00, 7.4562234e-01, # -9.0353303e-02, 1.7144661e+00, -6.0261071e-01, 3.3305642e-01, # 1.5906104e-01, -4.1968402e-01], # [ 1.5772353e+00, -3.7731435e+00, 1.3368907e-03, -5.4809654e-01, # -5.3378361e-01, 1.6364764e+00, -1.7407546e+00, 9.2192990e-01, # -1.3056380e+00, 4.4619998e-01], # [ 1.2414980e+00, -1.4788885e+00, 1.0041565e+00, 1.3526376e+00, # -3.9261341e-02, 1.7158917e+00, 5.9436530e-01, -6.7207557e-01, # 1.5145919e+00, 1.5831769e+00], # [-6.7959446e-01, 7.3509985e-01, -4.9694541e-01, 2.3607566e+00, # 1.8761678e+00, -2.5693741e-01, 4.7773087e-01, -3.4271333e+00, # -8.6632365e-01, 1.7058687e+00], # [-8.9738917e-01, -1.6301259e+00, -1.9925725e-01, 1.9296700e+00, # 3.3580008e-01, 7.9624134e-01, 7.0599653e-02, -1.5753354e+00, # -1.1833012e+00, -1.6767765e+00]], dtype=float32)] # 4000 0.0062668324 [array([[ 2.1299102 , 1.2199631 , -1.9996418 , -0.4861591 , -0.62715304, # 3.1333182 , 3.738693 , -1.7126851 , -2.4211333 , 1.179427 ], # [ 0.8013906 , 2.385532 , -1.1784177 , 3.3932443 , 0.4880144 , # 2.8164227 , -2.4529445 , -1.7608455 , 0.98015493, -0.89313626]], # dtype=float32), array([[ 0.57496756, -1.1736691 , -0.9972594 , -1.0736105 , -0.15833259, # 1.6707191 , -0.57505685, -0.5824107 , 2.849382 , -2.7256749 ], # [ 1.2611365 , -0.6522449 , -0.7655032 , -1.3744256 , 0.981028 , # -0.306891 , 0.6879813 , 0.60500425, -1.0885835 , -2.1927788 ], # [ 2.1903327 , 1.1156567 , 2.1339197 , 1.2491632 , -1.9360799 , # 1.0597996 , 0.8289054 , 1.88217 , -0.5816947 , 0.36828342], # [ 3.3188603 , 1.1329831 , 0.20344132, -2.1738672 , -1.1739721 , # 1.1124471 , -0.22963098, -1.0287988 , 0.35325825, -1.6209234 ], # [-0.11846752, 0.01453791, -0.17952484, 0.40497538, -0.23021454, # 0.42152682, -0.31700906, -0.96833545, 0.03400733, 0.9800598 ], # [-3.094519 , 2.2365012 , -1.7379518 , 0.8025263 , -0.09089415, # 1.7149462 , -0.6022326 , 0.33400995, 0.1852702 , -0.4949083 ], # [ 1.6935936 , -3.8586528 , 0.0268674 , -0.5931703 , -0.56948227, # 1.6363573 , -1.7448113 , 0.9235478 , -1.3346744 , 0.45511484], # [ 1.2830611 , -1.4811816 , 1.0333172 , 1.3735975 , -0.04733271, # 1.7158324 , 0.592763 , -0.67169875, 1.5072087 , 1.6226246 ], # [-0.74087256, 0.77362907, -0.5009244 , 2.4136775 , 1.8766272 , # -0.2567426 , 0.47726 , -3.426857 , -0.85548216, 1.7077329 ], # [-0.9444551 , -1.6583709 , -0.20916267, 1.9547541 , 0.33414868, # 0.79632455, 0.07051998, -1.5747913 , -1.176255 , -1.6902744 ]], # dtype=float32)] # 5000 0.0038290652 [array([[ 2.158215 , 1.234058 , -2.0278652 , -0.5256818 , -0.64012027, # 3.1951542 , 3.8026 , -1.7404848 , -2.4564648 , 1.1641247 ], # [ 0.8079992 , 2.394977 , -1.2074227 , 3.4760041 , 0.47667757, # 2.8787858 , -2.5082753 , -1.7832476 , 1.0289732 , -0.931802 ]], # dtype=float32), array([[ 0.5651688 , -1.1939732 , -1.0110985 , -1.0846362 , -0.16967584, # 1.6708384 , -0.57587516, -0.58169484, 2.8474932 , -2.7523167 ], # [ 1.3223727 , -0.6702581 , -0.76480144, -1.4164647 , 0.94925714, # -0.30677867, 0.6847813 , 0.6062118 , -1.1080569 , -2.2121859 ], # [ 2.2079482 , 1.1160115 , 2.1447794 , 1.256155 , -1.9404645 , # 1.0597996 , 0.82812816, 1.8823341 , -0.58515394, 0.3823034 ], # [ 3.3824186 , 1.1276817 , 0.20858635, -2.2057898 , -1.213583 , # 1.1126367 , -0.23414369, -1.0272537 , 0.33136085, -1.6364828 ], # [-0.12215169, 0.01929869, -0.17719437, 0.4184057 , -0.23980929, # 0.42162496, -0.31844595, -0.9678011 , 0.03229237, 0.98031753], # [-3.1901667 , 2.239988 , -1.7694052 , 0.834321 , -0.09120958, # 1.7152084 , -0.6022595 , 0.33463347, 0.20029481, -0.5358458 ], # [ 1.7584698 , -3.9031346 , 0.04012227, -0.6167427 , -0.5904558 , # 1.6363573 , -1.7467235 , 0.9245145 , -1.3500234 , 0.46024814], # [ 1.306135 , -1.4824505 , 1.0490292 , 1.3854021 , -0.05202341, # 1.7158324 , 0.59184545, -0.6714969 , 1.5031494 , 1.6438669 ], # [-0.77685064, 0.7939996 , -0.5032586 , 2.4437485 , 1.8767375 , # -0.2566308 , 0.47668022, -3.4266186 , -0.8493743 , 1.7082525 ], # [-0.97156847, -1.6725619 , -0.21517015, 1.9708402 , 0.3342952 , # 0.79638416, 0.07061329, -1.5744687 , -1.1712158 , -1.6971338 ]], # dtype=float32)] # 6000 0.0027019898 [array([[ 2.177025 , 1.2450169 , -2.0470583 , -0.55338234, -0.6486927 , # 3.2366164 , 3.8446074 , -1.7588326 , -2.4815328 , 1.1535497 ], # [ 0.8125668 , 2.402111 , -1.227346 , 3.5311158 , 0.46922767, # 2.920457 , -2.5448425 , -1.7982761 , 1.0607197 , -0.959533 ]], # dtype=float32), array([[ 0.5586296 , -1.2074597 , -1.0204432 , -1.0917684 , -0.17754003, # 1.6709576 , -0.5763916 , -0.5811755 , 2.8464026 , -2.769964 ], # [ 1.3636206 , -0.6824853 , -0.76408654, -1.4452077 , 0.92687035, # -0.30670667, 0.682658 , 0.6070399 , -1.1213158 , -2.224777 ], # [ 2.220007 , 1.1161715 , 2.1521516 , 1.2609274 , -1.9435934 , # 1.0597996 , 0.8275836 , 1.8824533 , -0.5875537 , 0.39180776], # [ 3.4245493 , 1.1236377 , 0.21223003, -2.2277985 , -1.2416885 , # 1.1127559 , -0.23724863, -1.0261936 , 0.31636658, -1.6467518 ], # [-0.12509438, 0.02217299, -0.17564857, 0.42755464, -0.2464263 , # 0.42168587, -0.3194652 , -0.96743715, 0.03119649, 0.9805532 ], # [-3.2547877 , 2.241835 , -1.7906307 , 0.8560057 , -0.09125539, # 1.715377 , -0.6023787 , 0.33509505, 0.2106791 , -0.5632565 ], # [ 1.8025017 , -3.9321914 , 0.04877569, -0.63203764, -0.6050703 , # 1.6363573 , -1.7478906 , 0.9251976 , -1.3601294 , 0.46384802], # [ 1.3217419 , -1.4833168 , 1.0595201 , 1.3934548 , -0.05531133, # 1.7158324 , 0.5912143 , -0.6713687 , 1.5003979 , 1.6580629 ], # [-0.8019674 , 0.8073724 , -0.50486094, 2.4643006 , 1.8767375 , # -0.25655252, 0.47616374, -3.4265053 , -0.84523064, 1.7084304 ], # [-0.990417 , -1.6816043 , -0.21943091, 1.9826984 , 0.33498925, # 0.796408 , 0.07073055, -1.5742303 , -1.1673188 , -1.7014993 ]], # dtype=float32)] # 7000 0.0020653303 [array([[ 2.1909187 , 1.2539284 , -2.0614662 , -0.5745814 , -0.6549975 , # 3.267401 , 3.8753853 , -1.7723105 , -2.50084 , 1.1456066 ], # [ 0.816023 , 2.4078207 , -1.2424005 , 3.571854 , 0.46377105, # 2.9513352 , -2.5717611 , -1.8094555 , 1.0837784 , -0.9810811 ]], # dtype=float32), array([[ 0.55378884, -1.2174075 , -1.02742 , -1.0969055 , -0.18346506, # 1.6709634 , -0.5767609 , -0.5807753 , 2.8456914 , -2.7829592 ], # [ 1.3943452 , -0.69163007, -0.7634433 , -1.4668187 , 0.9096985 , # -0.30664706, 0.6810968 , 0.6076677 , -1.1312783 , -2.2339249 ], # [ 2.229093 , 1.1162735 , 2.1576848 , 1.2645123 , -1.9460285 , # 1.0597996 , 0.8271646 , 1.8825725 , -0.5893835 , 0.39893267], # [ 3.455597 , 1.1203912 , 0.21504226, -2.2444465 , -1.263361 , # 1.1128751 , -0.23959082, -1.0253973 , 0.30504352, -1.6542804 ], # [-0.12752037, 0.024151 , -0.17450447, 0.43442005, -0.25142166, # 0.42173538, -0.32025006, -0.9671651 , 0.03040276, 0.980732 ], # [-3.3030236 , 2.2429702 , -1.8064629 , 0.8723125 , -0.09112735, # 1.7154962 , -0.60249794, 0.3354607 , 0.2185582 , -0.58358973], # [ 1.8354642 , -3.9533923 , 0.05509076, -0.6431056 , -0.6161796 , # 1.6363573 , -1.7487006 , 0.9257253 , -1.3675405 , 0.46661857], # [ 1.3333921 , -1.483973 , 1.0672969 , 1.3995006 , -0.05783708, # 1.7158324 , 0.59073496, -0.6712621 , 1.498334 , 1.6685987 ], # [-0.82112795, 0.8171456 , -0.50606346, 2.4797351 , 1.8767375 , # -0.2564929 , 0.47571024, -3.4265053 , -0.8421377 , 1.7084936 ], # [-1.004788 , -1.6880753 , -0.22271316, 1.9920886 , 0.3358843 , # 0.796408 , 0.07084301, -1.57406 , -1.1641396 , -1.7046112 ]], # dtype=float32)] # 8000 0.0016606675 [array([[ 2.2018466 , 1.261423 , -2.072938 , -0.5916896 , -0.65993834, # 3.2916882 , 3.8994346 , -1.7828612 , -2.5164785 , 1.1393179 ], # [ 0.8187851 , 2.4125872 , -1.2544433 , 3.6038957 , 0.4595089 , # 2.975667 , -2.5928795 , -1.8182943 , 1.1016679 , -0.9986645 ]], # dtype=float32), array([[ 0.54997957, -1.2252176 , -1.0329484 , -1.1008557 , -0.18816581, # 1.6709634 , -0.57703954, -0.5804449 , 2.8452146 , -2.7931533 ], # [ 1.418647 , -0.698881 , -0.76286745, -1.4840243 , 0.8958285 , # -0.306614 , 0.6798751 , 0.6081706 , -1.1392158 , -2.241025 ], # [ 2.2363448 , 1.1162735 , 2.1620822 , 1.2673615 , -1.9480206 , # 1.0597996 , 0.8268279 , 1.8826894 , -0.59086066, 0.40460145], # [ 3.4799619 , 1.1176924 , 0.2173282 , -2.257765 , -1.2809405 , # 1.1129943 , -0.24145918, -1.0247557 , 0.29598287, -1.6601597 ], # [-0.12957788, 0.02562167, -0.17360193, 0.4398793 , -0.2554054 , # 0.42176518, -0.32088518, -0.9669439 , 0.02978492, 0.98091084], # [-3.3412373 , 2.2437396 , -1.8190008 , 0.8853076 , -0.0908904 , # 1.7156154 , -0.60261714, 0.3357657 , 0.22487971, -0.59962255], # [ 1.8616333 , -3.9699056 , 0.06001274, -0.6516588 , -0.6250829 , # 1.6363573 , -1.749314 , 0.9261588 , -1.3733352 , 0.4688704 ], # [ 1.342619 , -1.4845008 , 1.0734302 , 1.4043105 , -0.05988564, # 1.7158324 , 0.59035057, -0.6712025 , 1.4966863 , 1.6769164 ], # [-0.83655167, 0.8247616 , -0.5070181 , 2.4920123 , 1.8767375 , # -0.25644022, 0.47530997, -3.4265053 , -0.8396919 , 1.7084936 ], # [-1.0163643 , -1.6930356 , -0.22537327, 1.9998609 , 0.33685428, # 0.796408 , 0.07094737, -1.5739408 , -1.1614556 , -1.7069826 ]], # dtype=float32)] # 9000 0.001382631 [array([[ 2.2108057 , 1.2678838 , -2.0824327 , -0.6059982 , -0.6639761 , # 3.31164 , 3.9190392 , -1.7914737 , -2.5295854 , 1.1341574 ], # [ 0.8210769 , 2.4166613 , -1.2644464 , 3.6301517 , 0.45603493, # 2.9956374 , -2.6101542 , -1.8255714 , 1.11617 , -1.0134932 ]], # dtype=float32), array([[ 0.54685706, -1.2316074 , -1.0375069 , -1.1040261 , -0.19202872, # 1.6709634 , -0.57726896, -0.58015907, 2.8448417 , -2.8014855 ], # [ 1.4386507 , -0.704858 , -0.7623515 , -1.4982564 , 0.8842295 , # -0.3065842 , 0.67888105, 0.6085903 , -1.1457914 , -2.24678 ], # [ 2.242345 , 1.1162735 , 2.1657183 , 1.2697127 , -1.9497054 , # 1.0597996 , 0.8265401 , 1.8826894 , -0.5920944 , 0.40929273], # [ 3.4998937 , 1.1153857 , 0.21925178, -2.2688227 , -1.2956939 , # 1.1130601 , -0.2430062 , -1.0242236 , 0.28844973, -1.6649492 ], # [-0.13136283, 0.02677253, -0.1728598 , 0.44439167, -0.2587014 , # 0.42179498, -0.32141808, -0.9667651 , 0.02928134, 0.98108965], # [-3.372728 , 2.244258 , -1.8293324 , 0.89606994, -0.09058315, # 1.7157346 , -0.60273635, 0.33602387, 0.23014432, -0.6127879 ], # [ 1.8832328 , -3.9833376 , 0.06401841, -0.6585635 , -0.6324763 , # 1.6363573 , -1.7497908 , 0.9265201 , -1.3780597 , 0.47076637], # [ 1.3502195 , -1.4849617 , 1.0784692 , 1.4082855 , -0.06160779, # 1.7158324 , 0.5900317 , -0.6711429 , 1.4953215 , 1.6837584 ], # [-0.8494236 , 0.8309543 , -0.5078012 , 2.502151 , 1.8767375 , # -0.25641042, 0.47495538, -3.4265053 , -0.83767986, 1.7084936 ], # [-1.0260365 , -1.6970153 , -0.22760478, 2.0064895 , 0.33783776, # 0.796408 , 0.07104254, -1.5738215 , -1.1591265 , -1.7088754 ]], # dtype=float32)] # 10000 0.0011807142 [array([[ 2.2183683 , 1.273557 , -2.0905142 , -0.61827326, -0.6673762 , # 3.328506 , 3.9355125 , -1.7987187 , -2.5408435 , 1.12981 ], # [ 0.8230295 , 2.4202325 , -1.2729844 , 3.6523025 , 0.45311633, # 3.0125089 , -2.624717 , -1.8317366 , 1.1282955 , -1.0263014 ]], # dtype=float32), array([[ 0.54422337, -1.2369925 , -1.0413734 , -1.1066575 , -0.19528635, # 1.6709634 , -0.5774478 , -0.57992065, 2.8446033 , -2.8085063 ], # [ 1.4555929 , -0.7099254 , -0.76188123, -1.5103555 , 0.87428266, # -0.3065544 , 0.6780469 , 0.60894793, -1.1513904 , -2.251603 ], # [ 2.2474587 , 1.1162735 , 2.1688151 , 1.2717165 , -1.951178 , # 1.0597996 , 0.8263017 , 1.8826894 , -0.59315777, 0.41328448], # [ 3.5166864 , 1.1133727 , 0.22091101, -2.2782516 , -1.3083837 , # 1.1130601 , -0.24432197, -1.0237467 , 0.28201368, -1.6689649 ], # [-0.13293704, 0.02770601, -0.17223123, 0.44822508, -0.26150155, # 0.42182478, -0.32187447, -0.9666031 , 0.0288571 , 0.9812633 ], # [-3.3994195 , 2.2446983 , -1.8380878 , 0.9052292 , -0.0902314 , # 1.7158538 , -0.60285556, 0.3362506 , 0.2346456 , -0.6239143 ], # [ 1.9015683 , -3.9946024 , 0.06738043, -0.664316 , -0.6387766 , # 1.6363573 , -1.7501613 , 0.926826 , -1.3820328 , 0.4724038 ], # [ 1.3566567 , -1.4853194 , 1.0827296 , 1.4116607 , -0.06309294, # 1.7158324 , 0.5897557 , -0.6710833 , 1.4941701 , 1.6895474 ], # [-0.86044717, 0.83614403, -0.5084674 , 2.5107696 , 1.8767375 , # -0.25638062, 0.47463658, -3.4265053 , -0.8359774 , 1.7084936 ], # [-1.0343298 , -1.7003143 , -0.22952333, 2.0122674 , 0.33882123, # 0.796408 , 0.07112978, -1.5737023 , -1.157072 , -1.7104328 ]], # dtype=float32)] # Hypothesis: [[7.8051293e-04] # [9.9923813e-01] # [9.9837923e-01] # [1.5565857e-03]] # Correct: [[0.] # [1.] # [1.] # [0.]] # Accuracy: 1.0