I often see uppercase and lowercase single character variables. I’m not sure if the case is chosen because the variable is an instance of a class, float32, or just personal preference.
Here is an example from Tensorflow's getting started guide. https://www.tensorflow.org/get_started/get_started
W = tf.Variable([.3], dtype=tf.float32)
b = tf.Variable([-.3], dtype=tf.float32)
x = tf.placeholder(tf.float32)
linear_model = W * x + b
I'm trying to understand if there is a specific reason why W is capitalized whereas b is lowercase when both are of the same type.
It's probably not a reflection of Python per se but of the math it captures. Usually the coefficients on x is a matrix which has a convention of being an uppercase variable. That this is a 1-dimensional example you're seeing obscures this convention, higher dimensions would be more telling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With