I am having a doubt understanding the the linear regression process in tensorflow. Below is my code snippet:
def linearmodel(X,w,b):
output = tf.matmul(X,w)+b
return output
x = tf.placeholder(tf.float32,[None,4])
y_ = tf.placeholder(tf.float32,[None,3])
w = tf.Variable(tf.random_normal([4,3],mean=0.0,stddev=0.05))
b= tf.Variable(tf.zeros([3]))
y_pred = linearmodel(x,w,b)
In the above code while training time i am passing 120 elements with 4 columns so in that case when i try to multiply tf.matmul(x,w) i will get a matrix of size nx3. Now i while adding it with b which is of shape 1x3 how the matrix addition is gonna happen as it is not following the matrix addition rule which states that only same size matrix can be added.
Sorry if this sounds very silly but i would be really grateful if anyone can help.