How to implement multivariate linear stochastic gradient descent algorithm in tensorflow?
问题 I started with simple implementation of single variable linear gradient descent but don't know to extend it to multivariate stochastic gradient descent algorithm ? Single variable linear regression import tensorflow as tf import numpy as np # create random data x_data = np.random.rand(100).astype(np.float32) y_data = x_data * 0.5 # Find values for W that compute y_data = W * x_data W = tf.Variable(tf.random_uniform([1], -1.0, 1.0)) y = W * x_data # Minimize the mean squared errors. loss = tf