Linear algebra

Machine learning became available after being able to store and process large amounts of data. To be able to process we need to convert that data into numerical form. Often times we have tabular structures which is converted into matrices. For higher dimensional problems we could have tensors or 4d tensors. Then, in order to process that information we need to rely on operations on matrices. Thus we will utilize linear algebra. The linear regression formulation we have mentioned uses weighted sum of input features. Let us remind that these features are the rows of the data table converted into numerical form. This weighted sum is inner product of two vectors could be written as : w = [w1, w2, ...] x = [x1, x2, ...] s = w1*x1 + w2*x2 ... The dot product of two vectors is a scalar. If vectors are normalized the result would be cosine similarity. Now, this is model of single neuron in neural networks. It gives single value output for single input vector. If we have multiple dimensional outputs we would have coefficients for each dimension. Thus, collection of weights becomes a matrix. The output becomes a vector in this case for single vector input.In this stage we talk about about shapes of the matrices. x(1xd1) x w'(d1xd2)-> s (1xd2) The convention in machine learningc community is using row vectors instead of columnn ones where length in first dimension usually represents the number of samples. You can releate this to excel tables. It is not much different if you have n samples. In this case your output will be matrix as well x(nxd1) x w'(d1xd2)-> s (nxd2) This matrix multiplication is in the core of running a neural network. The learning part is finding the best w's of these calculation to minimize the loss that we define.

Comments

Popular posts from this blog

When to do machine learning

Lets start coding for linear regression