Tensorflow 基礎 logistic regression

tf.placeholder(tf.float32, (N,2))  // para1: data type  para2: data shape 

tf.Variable(tf.random_normal(2,1)) //notice: V is capital letter & its initialize need to do at the end or during run()

                                                             using tf.global_variable_initializer() to initialinze all the variables

tf.squeeze(input)  //remove all the value equal to 1

tf.sigmoid(input)  //calculate the sigmoid value using y = 1/(1 + exp (-x)), exp(x) = e1/(e^{^{-x}}+1)

tf.round(input) //四捨五入到最接近的整數

tf.reduce_sum(input) // get the sum value of the inputs

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章