We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 796de7c commit c148ac5Copy full SHA for c148ac5
examples/2_BasicModels/linear_regression.py
@@ -28,9 +28,9 @@
28
X = tf.placeholder("float")
29
Y = tf.placeholder("float")
30
31
-# Set model weights
32
-W = tf.Variable(rng.randn(), name="weight")
33
-b = tf.Variable(rng.randn(), name="bias")
+# Set model weights and bias as variable (get_variable uses is recommended by tensorflow)
+W = tf.get_variable(initializer=rng.randn(), name="weight")
+b = tf.get_variable(initializer= rng.randn(), name="bias")
34
35
# Construct a linear model
36
pred = tf.add(tf.multiply(X, W), b)
0 commit comments