發表文章

目前顯示的是 7月, 2017的文章

tensorflow 學習之(2_

tf.train API 解 equation, y = W*x +b ,  The completed trainable linear regression model is shown here: import numpy as np import tensorflow as tf # Model parameters W = tf . Variable ([. 3 ], dtype = tf . float32 ) b = tf . Variable ([-. 3 ], dtype = tf . float32 ) # Model input and output x = tf . placeholder ( tf . float32 ) linear_model = W * x + b y = tf . placeholder ( tf . float32 ) # loss loss = tf . reduce_sum ( tf . square ( linear_model - y )) # sum of the squares # optimizer optimizer = tf . train . GradientDescentOptimizer ( 0.01 ) train = optimizer . minimize ( loss ) # training data x_train = [ 1 , 2 , 3 , 4 ] y_train = [ 0 ,- 1 ,- 2 ,- 3 ] # training loop init = tf . global_variables_initializer () sess = tf . Session () sess . run ( init ) # reset values to wrong for i in range ( 1000 ):   sess . run ( train , { x : x_train , y : y_train }) # evaluate training accuracy curr_W , curr_b , curr_loss...

tensor flow 之學習 (1)

 上python 官網 down 3.5.x 版本 installer 係vs code 裝返 python 既 extension configure vs code setting  { "name" : "Python" , "type" : "python" , "request" : "launch" , "stopOnEntry" : true , "pythonPath" : "{YOURPATHFOR}/python.exe" , "program" : "${file}" , "cwd" : " {YOURPATHFOR} " , "env" : {}, "envFile" : "${workspaceRoot}/.env" , "debugOptions" : [ "WaitOnAbnormalExit" , "WaitOnNormalExit" , "RedirectOutput" ] }, 跟住 To install TensorFlow, start a terminal. Then issue the appropriate   pip3 install   command in that terminal. To install the CPU-only version of TensorFlow, enter the following command: C:\> pip3 install --upgrade tensorflow To install the GPU version of TensorFlow, enter the following command: C:\> pip3 install --upgrade...