Error in Python matrix calculation
In this case, if the matrix is not a square matrix, the following error will appear:
It is worth noting that when we use it in this way, the program will run normally
It seems that we have obtained the inverse of a non square matrix
Now let’s verify:
If you look at it carefully, it’s not a unit array. I think this method is not feasible, but with the idea of blog rigor, I decided to see the results of the square array
seeing here, I found that the inversion of square matrix also appeared abnormal. I can’t help but look carefully. The original term which should be 0 is very small. Friends who have studied numerical analysis should know that this is a non-zero problem caused by the rounding error of computer, so we can regard both as unit matrix
note: don’t convert the data type at will here, because converting the data type will result in the loss of data accuracy. For example, the unit matrix mentioned above will change when converting the data type, and a bit on the diagonal line may become 0. the unit matrix mentioned above will change when converting the data type
Similar Posts:
- How to solve the problem of “no observations” in Stata?
- [Solved] Tensorflow Error: ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type numpy.ndarray)
- Numpy.linaling.linalgerror: singular matrix solved successfully
- R Language Error: rowMeans(new1) : ‘x’ must be an array of at least two dimensions
- Image data type conversion uint8 and double in MATLAB
- tf.nn.top_k(input, k, name=None) & tf.nn.in_top_k(predictions, targets, k, name=None)
- Inkscape – rounding corners of shapes
- [Solved] Vuex error: Error in callback for watcher “function() {return this._data.$$state}”
- Error reporting on data type and matrix dimension of eigen
- Keras.utils.to in keras_ Categorical method