There is z that transforms y as a result of dot producting the arrays x and w.
I want to create a program that uses these z and w to return to the original x.
import numpy as np
x = np.array ([[0, 1, 4, 5],
[1, 2, 5, 6],
[2, 3, 6, 7],
[4, 5, 8, 9],
[5, 6, 9, 0],
[6, 7, 0, 1],
[8, 9, 2, 3],
[9, 0, 3, 4],
[0, 1, 4, 5],])
w = np.array ([,
y = np.dot (x, w)
z = y.reshape (1, 3, 3, -1) .transpose (0, 3, 2, 1)
How can I write this operation from z to y in numpy?
Do the reverse of y = np.dot (x, w)
I would like to know if there is a function that calculates the inverse of the inner product of y and w.
What I did
y_ = z.transpose (0,2,3,1) .reshape (-1,1)
x_ = np.dot (y_, w_.T)
But x_ did not revert to the original x.
Answer # 1
Here's a simple example.
Where x1 and x2 are different vectors, but w and the inner product y1 and y2 have the same value.
In other words, in principle, it is not possible to obtain the original vector from the inner product.
import numpy as np x1 = np.array ([1,2]) x2 = np.array ([1,3]) w = np.array ([2,0]) y1 = np.dot (x1, w) print (y1) #->2 y2 = np.dot (x2, w) print (y2) #->2
- how to save the image ocr result file in python
- python - i want to display the scraping result in the browser
- python - saving the calculation result of the correlation coefficient
- the calculation result of python print (1/2) becomes 0
- python - next day forecast result display error
- parameters - about error when calculating python sarimx parameter optimization
- python 3x - i want to divide the process when it is err as a result of command execution in python3 subprocess
- please tell me how to write a program to end when the result is executed 5 times [python]
- i want to output the entry result of tkinter with python
- about for syntax i want to know the reason why the result is different depending on where the initial value is defined python
- python - typeerror when calculating the array of images called by imageopen ()
- python - i want to get the same result as assigning a variable and writing it directly in a function
- excel python i want to get the display result instead of the conditional statement
- python 3x - the output result of the numerical value obtained by web scraping becomes 0
- python - i'm going to iterate, but only one result is returned
- i want to adjust the execution result using the while statement in python as expected
- python - what you do not understand by calculating the precision and recall
- python difflib i want to output the comparison result as text
- python - i want to hide the result of gacha that is displayed as 0
- python : In the Keras CNN, the input array and the target (teacher) array does not match
- python : How to create a second one on a column that will reflect the content of the first?
- python : There are numbers in order, but with skipping. How to get intervals?
- python : Sort positive and negative values within the variable
- Trust intervals for regression model parameters in Python
- python : How to find points functions
- python : Randomly retrieve data from the list and make a new data list
- python : ITERATOR GLOBAL FLAGS MUST BE A LIST OR TUPLE OF STRINGS ERROR
- Python Numpy Sort
- Scikit Learn Python