I am currently building a FeedForward Neural Network library on C# and am struggling with matrix multiplication.
To those who are familiar with MathNet library; is there an existing function where it can take a Matrix and Vector (or versa) and return a Scalar as dot product?
Thanks in advance.
You are correct, there doesn't seem to be an existing function for it. You can use the following:
double dotproduct = 0;
for (i = 0; i <= m.ColumnCount; i++) {
dotproduct += m.Column(i).DotProduct(v);
}
the * operator between two vector objects in mat.net.numerics is their dot product.
Also, if you multiply an mxn matrix with a vector of length n, you get the scalar dot product results of each row of the matrix with the vector in the as a vector in the output.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.