As an assignment i have to create a spiral matrix where the user inputs the number of rows and number of columns. This is my code for far (first year in colleg
I have a code to calculate cosine similarity between two matrices: def cos_cdist_1(matrix, vector): v = vector.reshape(1, -1) return sp.distance.cdist(
I would like to calculate a couple of texture features (namely: small/ large number emphasis, number non-uniformity, second moment and entropy). Those can be co
I'm trying to implement the following operation using AVX: for (i=0; i<N; i++) { for(j=0; j<N; j++) { for (k=0; k<K; k++) { d[i][j] += 2 *
How do I increase the width of an apa_table in R Markdown. I'm using the papaja package. I would like the width to be long enough to fit the table's title. This
I have a nested list of matrices. More specifically, I have a list of matrix lists, each with a variable number of matrices. I would like to extract all the mat
I have a task - write multithreading matrix multiplication. Each vector product must be calculated in new thread.(If we have matrices n by m and m by k we must
For a current project I have to compute the inner product of a lot of vectors with the same matrix (which is quite sparse). The vectors are associated with a tw
I'm focusing on the special case where A is a n x d matrix (where k < d) representing an orthogonal basis for a subspace of R^d and b is known to be inside t
Is there a fast way in numpy to add a vector to every row or column of a matrix. Lately, I have been tiling the vector to the size of the matrix, which can use
I have a NumPy ndarray to which I would like to add row/column headers. The data is actually 7x12x12, but I can represent it like this: A=[[[0, 1, 2, 3, 4, 5]
I'm pretty new to programming in R. I have a matrix of numbers mat, as well as a list of matrices matlist. I want to check if the matrix mat matches with (i.e
I have multiple estimates for a transformation matrix, from mapping two point clouds to each other via ICP (Iterative Closest Point). How can I generate the av
Does Python or any of its modules have an equivalent of MATLAB's conv2 function? More specifically, I'm interested in something that does the same computation a
I am solving a larger problem and at one step I need to rotate a 2D array counter-clockwise. So if I have this matrix: 1 2 3 4 1 2 3 4 3 4 5 6 3 4 5 6 After
I've got coordinates of 4 points in 2D that form a rectangle and their coordinates after a perspective transformation has been applied. The perspective trans