matrix-multiplication Questions
2
Why does t(mat1) %*% mat2 work quicker than crossprod(mat1, mat2). Isn't the whole point of the latter that it calls a more efficient low-level routine?
r$> mat1 <- array(rnorm(100 * 600), di...
Jessejessee asked 3/10 at 5:24
1
Solved
I compared the performance of 3x3 and 4x4 matrix multiplication using Eigen with the -O3 optimization flag, and surprisingly, I found that the 4x4 case is more than twice as fast as the 3x3 case! T...
Tamberg asked 26/8 at 16:23
3
Solved
I am asking if it is possible to improve considerably integer matrix multiplication with bitwise operations. The matrices are small, and the elements are small nonnegative integers (small means at ...
Cadence asked 8/5, 2016 at 10:36
5
Solved
I have two matrices
a = np.matrix([[1,2], [3,4]])
b = np.matrix([[5,6], [7,8]])
and I want to get the element-wise product, [[1*5,2*6], [3*7,4*8]], which equals
matrix([[5, 12], [21, 32]])
I have...
Pinchpenny asked 14/10, 2016 at 4:35
1
Solved
I have this function in C++
void routine2(float alpha, float beta) {
unsigned int i, j;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
w[i] = w[i] - beta + alpha * A[i][j] * x[j];
}
...
Hebetate asked 19/12, 2023 at 21:4
11
I'm trying to make a simple matrix multiplication method using multidimensional arrays ([2][2]). I'm kinda new at this, and I just can't find what it is I'm doing wrong. I'd really appreciate any h...
Guillema asked 12/7, 2013 at 20:55
2
According to MKL BLAS documentation
"All matrix-matrix operations (level 3) are threaded for both dense and sparse BLAS."
http://software.intel.com/en-us/articles/parallelism-in-the-intel-math-kern...
Countable asked 18/6, 2013 at 0:27
4
Solved
I know @ is for decorators, but what is @= for in Python? Is it just reservation for some future idea?
This is just one of my many questions while reading tokenizer.py.
Menashem asked 9/12, 2014 at 17:59
2
Solved
What would be the most efficient way to multiply (element-wise) a 2D tensor (matrix):
x11 x12 .. x1N
...
xM1 xM2 .. xMN
by a vertical vector:
w1
...
wN
to obtain a new matrix:
x11*w1 x12*w2 ... x...
Danieldaniela asked 10/12, 2015 at 1:32
14
Solved
I'm doing a function that multiplies 2 matrices.
The matrices will always have the same number of rows and columns. (2x2, 5x5, 23x23, ...)
When I print it, it doesn't work. Why?
For example, if I c...
Gamete asked 29/11, 2014 at 17:36
2
Solved
I would like to implement a parallel matrix-vector multiplication for a fixed size matrix (~3500x3500 floats) optimized for my CPUs and cache layout (AMD Zen 2/4) that is repeatedly executed for ch...
Strontia asked 25/2, 2023 at 1:2
1
Solved
I was tasked with implementing an optimised matrix multiplication micro-kernel that computes C = A*B in C++ starting from the following snippet of code. I am getting some counter intuitive behaviou...
Owing asked 4/3, 2023 at 17:52
5
Solved
CUDA runtime has a convenience function cudaGetErrorString(cudaError_t error) that translates an error enum into a readable string. cudaGetErrorString is used in the CUDA_SAFE_CALL(someCudaFunction...
Misshapen asked 24/10, 2012 at 0:38
1
Solved
I noticed that evaluating matrix operations in quadratic form from right to left is significantly faster than left to right in R, depending on how the parentheses are placed. Obviously they both pe...
Dael asked 13/10, 2022 at 20:28
12
I'm trying to multiply two matrices together using pure Python. Input (X1 is a 3x3 and Xt is a 3x2):
X1 = [[1.0016, 0.0, -16.0514],
[0.0, 10000.0, -40000.0],
[-16.0514, -40000.0, 160513.6437]]...
Realgar asked 8/5, 2012 at 23:41
3
Is it possible to do from matrix_multiply_elementwise in sympy library with more than two matrices? Or any other way for multiplying couple of matrices elementwise?
p.s.
In numpy it is straightfo...
Anthonyanthophore asked 9/8, 2017 at 10:59
5
Solved
ma=diag(3)+t(da)%*%da
R Code above, error message as follows:
Error in t(da) %*% da : requires numeric/complex matrix/vector arguments
da is a matrix, looks as following:
V45 V46 V47 V48 V49 ...
Rothko asked 7/4, 2014 at 8:7
3
Background
I have to implement Cannon's Algorithm which is a parallel algorithm for multiplying matrices that are square in dimension and the dimension is divisible by the square root of the numbe...
Idyll asked 14/4, 2015 at 21:13
2
Assume I have two matrices, A and B, and I want to compute C = AB using the sum of outer products.
I have written this function to achieve that, but I am wondering If can eliminate the for loop and...
Spaak asked 2/3, 2022 at 11:6
5
Solved
I'm new to the CUDA paradigm. My question is in determining the number of threads per block, and blocks per grid. Does a bit of art and trial play into this? What I've found is that many examples h...
Maren asked 8/12, 2010 at 18:58
1
Solved
I have tried speeding up a toy GEMM implementation. I deal with blocks of 32x32 doubles for which I need an optimized MM kernel. I have access to AVX2 and FMA.
I have two codes (in ASM, I apologies...
Oke asked 13/12, 2021 at 20:48
3
Solved
I needed to implement 'choosing an object' in a 3D environment. So instead of going with robust, accurate approach, such as raycasting, I decided to take the easy way out. First, I transform the ob...
Totality asked 8/1, 2014 at 22:8
5
Solved
I came up with this algorithm for matrix multiplication. I read somewhere that matrix multiplication has a time complexity of o(n^2).
But I think my this algorithm will give o(n^3).
I don't know ...
Underfeed asked 17/12, 2011 at 17:59
2
Solved
I'm wondering how to get functionality similar to numpy.einsum in Julia.
Specifically, I have a 3rd order tensor that I'm looking to multiply by a 2nd tensor (matrix), contracting both of the dime...
Descriptive asked 20/3, 2014 at 1:18
2
Solved
I have two numpy arrays a and b of shape [5, 5, 5] and [5, 5], respectively. For both a and b the first entry in the shape is the batch size. When I perform matrix multiplication option, I get an a...
Eonian asked 17/7, 2021 at 16:19
1 Next >
© 2022 - 2024 — McMap. All rights reserved.