Tensorex.Analyzer.singular_value_decomposition
You're seeing just the function
singular_value_decomposition
, go back to Tensorex.Analyzer module for more information.
Specs
singular_value_decomposition(Tensorex.t()) :: {Tensorex.t(), Tensorex.t(), Tensorex.t()}
Finds the singular values and the singular vectors of the given matrix.
Returns a 3-element tuple that contains the left singular vectors (U
), the diagonal containing
singular values (S
) and the right singular vectors (V
). The dot product of them (U·S·V^T
)
results to the given matrix.
iex> Tensorex.Analyzer.singular_value_decomposition(Tensorex.from_list([[1, 2, 3],
...> [2, 3, 5],
...> [3, 8, 9],
...> [4, 5, 6]]))
{%Tensorex{data: %{[0, 0] => 0.2226615344045355 , [0, 1] => -0.05855885924201132, [0, 2] => -0.3843955833877411 ,
[1, 0] => 0.36536351530221217, [1, 1] => 0.15902949910885741, [1, 2] => -0.8106021820799661 ,
[2, 0] => 0.7400203406817314 , [2, 1] => -0.6059441250735513 , [2, 2] => 0.2714639225744238 ,
[3, 0] => 0.518942422779177 , [3, 1] => 0.7772465475679571 , [3, 2] => 0.3485275837286095 }, shape: [4, 3]},
%Tensorex{data: %{[0, 0] => 16.709361526261223 ,
[1, 1] => 1.6718956724884724 ,
[2, 2] => 1.0010006218857228 }, shape: [3, 3]},
%Tensorex{data: %{[0, 0] => 0.3141484053667126 , [0, 1] => 0.9274824856259514 , [0, 2] => 0.20269932970451207,
[1, 0] => 0.6018355900828712 , [1, 1] => -0.3596812252112713 , [1, 2] => 0.7130381046901498 ,
[2, 0] => 0.73423749694166 , [2, 1] => -0.10200811285199618, [2, 2] => -0.6711852523686888 }, shape: [3, 3]}}