Computes the solution to the least squares and least norm problems for a full rank matrix A of size (m,n) and a matrix B of size (m,k).

tch_gels(x, A)

Arguments

x

tensor object

A

the m,b by nn matrix A

Examples

A <- tensor(matrix(runif(100), ncol = 10)) y <- tensor(matrix(runif(10), ncol = 1)) tch_gels(y, A)
#> [[1]] #> tensor #> 0.2110 #> -0.9201 #> 0.3935 #> 0.6024 #> 0.6072 #> -0.1660 #> -0.7642 #> -0.2543 #> 0.7081 #> 0.6277 #> [ Variable[CPUFloatType]{10,1} ] #> #> [[2]] #> tensor #> -2.0219 -1.6027 -1.3651 -1.3294 -1.1907 -1.3732 -1.1550 -1.8738 -1.0506 -1.6168 #> 0.2764 1.1768 0.3825 0.6945 0.7640 0.5197 0.3655 0.3254 0.7436 0.7046 #> 0.1390 -0.4885 1.0842 -0.1338 0.6337 0.2064 -0.0344 -0.0051 0.0428 0.1625 #> 0.4066 0.0845 0.3129 0.7914 0.3104 -0.1048 0.6457 0.4495 -0.1290 -0.3964 #> 0.3987 0.0556 0.5946 -0.2235 0.7092 0.3892 0.1450 0.3231 -0.1086 0.1597 #> 0.0405 -0.6786 -0.0643 -0.4920 0.1990 -0.9383 0.0849 0.0921 -0.3273 0.0305 #> 0.3245 -0.1553 -0.0111 -0.1509 0.4692 0.0026 0.5025 0.0676 0.4156 -0.4264 #> 0.2506 -0.4376 -0.0740 0.5600 0.0119 -0.1470 0.3403 0.7147 -0.5241 0.1209 #> 0.3063 0.0615 0.2792 0.2479 0.1414 0.1628 0.1051 -0.1884 -0.3687 0.2782 #> 0.3082 0.1835 -0.1191 -0.2112 -0.0601 -0.0963 -0.5181 -0.4705 -0.1940 -0.3266 #> [ Variable[CPUFloatType]{10,10} ] #>