name
पैरामीटर वैकल्पिक है (आप चर या स्थिरांक बना सकते हैं या इसके बिना), और आपके प्रोग्राम में उपयोग किए जाने वाले चर पर निर्भर नहीं है। नाम कुछ स्थानों में सहायक हो सकते हैं:
जब आप अपने चर को सहेजना या पुनर्स्थापित करना चाहते हैं (आप गणना के बाद save them to a binary file कर सकते हैं)। docs से:
By default, it uses the value of the Variable.name property for each variable
matrix_1 = tf.Variable([[1, 2], [2, 3]], name="v1")
matrix_2 = tf.Variable([[3, 4], [5, 6]], name="v2")
init = tf.initialize_all_variables()
saver = tf.train.Saver()
sess = tf.Session()
sess.run(init)
save_path = saver.save(sess, "/model.ckpt")
sess.close()
बहरहाल आप चर matrix_1
, matrix_2
वे कर रहे हैं है बचाता है v1
, v2
फ़ाइल में के रूप में।
टेंसरबोर्ड में नामों का नाम अच्छी तरह से किनारों के नाम दिखाने के लिए उपयोग किया जाता है। तुम भी group them by using the same scope कर सकते हैं:
import tensorflow as tf
with tf.name_scope('hidden') as scope:
a = tf.constant(5, name='alpha')
W = tf.Variable(tf.random_uniform([1, 2], -1.0, 1.0), name='weights')
b = tf.Variable(tf.zeros([1]), name='biases')
स्रोत
2015-11-11 10:10:40