Questions tagged [matrix]

A matrix is a collection of numbers arranged into a fixed number of rows and columns.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

Selecting Data from 2 Dimensional Empirical Data Set in Excel

I have a set of efficiency values based on 2 dependent variables (speed and torque). These numbers are provided from the manufacturer and I want to fit the efficiency values to a set of personal test ...
user avatar
1 vote
1 answer
10 views

memory error- python N-th order Markovian transition matrix from a given sequence

Ok. What is wrong with you code! I am trying to calculate transition probabilities for each leg. The code works for small array but for the actual dataset I got memory error. I have 64 g version ...
user avatar
1 vote
0 answers
26 views

How to compute backpropagation gradient according chain rule for using vector/matrix differential?

I have some problems for computing derivative for sum of squares error in backprop neural network. For example, we have a neural network as in picture. For drawing simplicity, i've dropped the sample ...
user avatar
0 votes
0 answers
14 views

Creating a Collaboritve Filtering with No Ratings for a football player Recommender System

I'm creating a recommendation system of football players based on stats of each player (number of passes, crosses, shots, tackles, etc ...) and I have already tried with a Content based recommender. ...
user avatar
0 votes
1 answer
30 views

Build autoencoder for single matrix with integer numbers

Can you please tell me how to build an autoencoder with a single matrix(4,4) with integer numbers? I want to build an autoencoder for the below-mentioned data. I don't know whether I should convert ...
user avatar
0 votes
1 answer
14 views

Block matrix indexing

Hello this might be a stupid question but i need some help indexing a Matlab matrix consisting of several sub-matrices. ...
user avatar
2 votes
0 answers
53 views

How is image convolution actually implemented in deep learning libraries using simple linear algebra?

As a clarifier, I want to implement cross-correlation, but the machine learning literature keeps referring to it as convolution so I will stick with it. I am trying to implement image convolution ...
user avatar
0 votes
4 answers
570 views

Creating & handling large matrices in python? [closed]

I need to create a large matrix of size 400,000*400,000 and do some transformation on it. I am not able to do it using python in my laptop due to memory constraints. What technologies I can use to ...
user avatar
0 votes
1 answer
20 views

ML for data processing. What are the options?

Currently I am working on improving a stage on a data processing pipeline. The source data has a large number of fields and is getting normalized into a simpler entity. This entails that in many cases ...
user avatar
  • 101
0 votes
0 answers
22 views

Represent Neural Network as matrix calculation (Transformer Feed Forward NN)

for better understanding, I would like to represent the calculations in a neural network with one hidden layer and one output layer as a matrix calculation. The hidden layer has 3072 neurons, the ...
user avatar
0 votes
0 answers
19 views

Matrix multiplication

I have downstream gradient for every $sample$ (each row for every $x_i$) $$ \begin{bmatrix} 0.0062123 & -0.00360166 & -0.00479891 \\ -0.01928449 & 0.01240768 & 0.01493274 \\ ...
user avatar
0 votes
0 answers
24 views

Inverting a matrix using a convolutional neural network

Just for a fun exercise, I am trying to invert a matrix, say size 28x28 (or even 5x5) with a neural network. The way I approached this (quite naively) is as follows: I built a fully convolutional ...
user avatar
  • 90
0 votes
2 answers
27 views

Attention transformation - matrices

Could somebody explain which matrix dimension should be found here - K? and if it is for example 3X3, should I use just 9?
user avatar
1 vote
0 answers
10 views

Efficient method of performing within matrix similarity

I want to compute a similarity comparison for each entry in a dataset to every other entry that is labeled as class 1 (excluding the current entry if it has a label of 1). So, consider a matrix of ...
user avatar
  • 167
0 votes
0 answers
13 views

Reducing dataset before computing similarity matrix

I'm writing my thesis and am trying to calculate a similarity matrix of houses. I currently have a dataset of 500,000 houses that I need to calculate the similarity between. I.e. I need to calculate ...
user avatar
0 votes
0 answers
21 views

Correct dimensions of a Siamese network Input array

I have an image dataset where the folder structure is as follows- there are 900 folders (all of which will be classes) and in each folder, we have a varying number ...
user avatar
0 votes
1 answer
21 views

Efficient way to create matrix that shows if data exits per day [closed]

So I have a dataset containing different ID's and the time the data was created. ...
user avatar
1 vote
3 answers
57 views

converting array to a true/false matrices

I have a data set where each record is a json document with a label, and an array of signals. The signals will vary for each record: ...
user avatar
  • 111
1 vote
1 answer
174 views

PCA, covariance, eigenvector matrix and rotation [closed]

I am following the Coursera NLP specialization, and in particular the lab "Another explanation about PCA" in Course 1 Week 3. From the lab, I recovered the following code. It creates 2 ...
user avatar
0 votes
1 answer
167 views

Which openCv function can be used to compute BEV perspective transformation given a point coordinates and the camera extrinsics/intrinsics?

I have the 3x3 intrinsics and 4x3 extrinsics matrices ...
user avatar
  • 125
0 votes
0 answers
116 views

What does an image pose (camera to world) mean?

I have 1000 2D images of a 3D scene. For each image, I have pose (camera to world) as follows: ...
user avatar
  • 155
0 votes
1 answer
37 views

How to get used to matricial/vectorial operations?

I came to data science/machine learning from another background in computer science and i feel that i'm lacking of experience with matricial/vectorial operations. Python or Matlab, for instance, ...
user avatar
1 vote
1 answer
33 views

Matrix notation in Sutton and Barto

On pg. 206 of Barto and Sutton's Reinforcement Learning, there is a curious statement about the result of a scalar product: As I interpret it, A is the expectation of a scalar product of two d-...
user avatar
  • 113
1 vote
0 answers
89 views

How can I get a value of context vector in GPT?

I'm a newbie in NLP and I'm now stuck in GPT. The question I'm struggling with is related to a term 'context vector' It says in the following (sorry that the material provided is written in korean) ...
user avatar
  • 11
1 vote
0 answers
20 views

Sparse Covariance Selection

I was reading this article https://www.di.ens.fr/~aspremon/PDF/CovSelSIMAX.pdf, whose goal is to estimate the covariance matrix from a the sample covariance matrix drawn from a distribution $X$. ' ...
user avatar
  • 11
1 vote
1 answer
217 views

Conventions for dimensions of input and weight matrices in neural networks?

Im currently learning neural networks and I see conflicting decsriptions of the dimensions of weight and input matrices on the internet. I just wanted to know if there is some convention which more ...
user avatar
-1 votes
2 answers
50 views

what is the meaning of $\mathbb{R}^{768\times (768 * 2)}$?

Hi I'm an undergraduate student interested in Machine Learning. I was reading a paper from ICLR 2020 and came a cross a weird looking vector dimensions. Can anyone tell me what this means?? $\mathbb{R}...
user avatar
  • 3
3 votes
1 answer
3k views

What types of matrix multiplication are used in Machine Learning? When are they used?

I'm looking at equations for neural networks and backpropagation and I see this symbol in the equations, ⊙. I thought matrix multiplication of neural networks always involved matrices that matched ...
user avatar
  • 157
1 vote
1 answer
38 views

Can all known ML algorithms be written as a sequence of matrix operations?

I keep hearing that machine learning is just linear algebra. Does that mean all known (and all possible?) ML algos, from random forest, to support-vector machines, to recursive neural networks, can ...
user avatar
0 votes
1 answer
291 views

How to create a matrix from two given vectors in R in RStudio?

Suppose, $c(1, 2, 3, 4)$ and $c(2, 4, 5, 6)$ are two vectors. Then in R or RStudio, How to create a $4\times 2$ matrix from these two vectors? Also, how to add another vector $c(8, 9, 10, 11)$ ...
user avatar
  • 103
0 votes
1 answer
872 views

Trying to understand the result provided by np.linalg.norm function in numpy (normalisation)

I'm new to data science with a moderate math background. I'm playing around with numpy and can across the following: So after reading np.linalg.norm, to my ...
user avatar
0 votes
1 answer
95 views

How do I use matrix math in irregular neural networks such as those generated from neuroevolution (NEAT)?

I understand how to structure the matrix when every node in a layer is fully connected to every node in adjacent layers and I understand that in "irregular" neural networks I can just process each ...
user avatar
1 vote
0 answers
24 views

What is the kernel matrix used for in the kernel trick?

I have $n$ linearly inseperable datapoints, $x_1 \dots , x_n$. I use the kernel trick to map and compute the dot product in higher dimensions (without actually mapping / transforming the data). ...
user avatar
1 vote
1 answer
370 views

How to compute Hessian matrix for log-likelihood function for Logistic Regression

I am currently studying the Elements of Statistical Learning book. The following equation is in page 120. It calculates the Hessian matrix for the log-likelihood function as follows \begin{equation} ...
user avatar
0 votes
1 answer
28 views

Why don't the dimensions in this linear regression equation match up?

I'm going through an article on linear regression, and they give the following formula for computing estimates: The convention is that all vectors are column vectors. So if ...
user avatar
  • 111
3 votes
1 answer
169 views

tensorflow pseudo inverse doesn't work for complex matrices!

The Tensorflow documentation here says that: tf.linalg.pinv is ''analogous to numpy.linalg.pinv. It differs only in default value of rcond''. However, tf.linalg.pinv requires the matrix to ...
user avatar
  • 33
2 votes
1 answer
35 views

Recommender system that matches similar customers with similar highly rated products?

I have a dataset of 1,000 customers that bought 20 distinct phones and rated them 1-5. I have several demographic attributes for these customers (gender, age). My website offers 100 distinct devices, ...
user avatar
  • 171
1 vote
0 answers
205 views

Scipy Sparse vstack memory error

I have a bunch of scipy matrices (of the same #columns) loaded from disk. I want to combine them into one scipy sparse matrix. I am using scipy sparse vstack method. I am able to load the ...
user avatar
1 vote
0 answers
19 views

Question regarding: Vectorization Math of Backpropagation in a Neural Network

Formula: These are the formula I use for backpropagation from Brilliant: Question: If we consider a Neural Network with the structure (3,2): And we would start calculating the derivative (for 1 ...
user avatar
  • 133
1 vote
1 answer
92 views

List of Correlations to Correlation Matrix [closed]

I am using python to do some data analysis and I need to represent the following table as a correlation matrix. The correlation value is a value between -1 and 1. ...
user avatar
0 votes
1 answer
3k views

Normalize / Standardize in a Random Forest?

If I have a matrix of co-occurring words in conversations of different lengths, is it appropriate to standardize / normalize the data prior to training? My matrix is set up as follows: one row per ...
user avatar
  • 169
0 votes
0 answers
31 views

Linear Regression Error in feature matrix step

I'm trying to code the design function used in linear regression using numpy and I get this error: Traceback (most recent call last): File "C:\Users\visha\AppData\Local\Continuum\anaconda3\lib\...
user avatar
  • 359
0 votes
2 answers
4k views

How do I generate a laplacian matrix for a graph dataset?

If I have a dataset in a csv that looks like the one shown below. How do I convert this into a laplacian matrix using Python?
user avatar
  • 41
1 vote
2 answers
43 views

Removing # from header

I have a $(418,2)$ matrix and I want to convert it to csv. so I write: np.savetxt('titanic1.csv', Sol, fmt='%.2f', delimiter=",",header="PassengerId,Survived") ...
user avatar
0 votes
0 answers
160 views

Transformation of matrix with missing values for hierarchical clustering

Comparing different variables, I got a matrix with lots of missing values. How do I have to transform the matrix below for hierarchical clustering? What I have already tried: ...
user avatar
5 votes
1 answer
5k views

Calculating cosine similarity between 3D arrays using Python

I have two matrices with multiple columns and three rows each. I calculated the cosine similarity (sklearn) but it gives the result as a matrix. How can I obtain one single value? The matrices are the ...
user avatar
3 votes
2 answers
1k views

Is there a difference between np.matrix(np.array([0,0])) and np.matrix([0,0])?

I was reading this code, for implemnting linear regression from scratch: ...
user avatar
2 votes
1 answer
2k views

Computation of kernel matrix using radial basis kernel in svm

I want to compute a kernel matrix using RBF on my own. The training data is multidimensional. My query is whether we will apply $$e^{-\gamma(x-y)^2}$$ for each dimension and then sum the values across ...
user avatar
1 vote
0 answers
45 views

How does on test regression for a subspace or matrix factorization?

I've recently been reading a lot of papers and watching a lot of videos on both subspace learning, and matrix factorization. One thing is particularly eluding me though - how does any of this get ...
user avatar
  • 141
1 vote
1 answer
387 views

Having difficult interpreting the eigenvectors for a simple 3x2 matrix

I calculated the eigenvectors and eigenvalues from a covariance matrix given a data matrix of 3 columns and 2 rows. I am trying to interpret results but I can't understand on how to interpret them. ...
user avatar