# tensorly.decomposition.non_negative_tucker_hals

non_negative_tucker_hals(tensor, rank, n_iter_max=100, init='svd', svd='truncated_svd', tol=1e-08, sparsity_coefficients=None, core_sparsity_coefficient=None, fixed_modes=None, random_state=None, verbose=False, normalize_factors=False, return_errors=False, exact=False, algorithm='fista')[source]

Non-negative Tucker decomposition with HALS

Uses HALS to update each factor columnwise and uses fista or active set algorithm to update the core, see 

Parameters:
tensorndarray
rankNone, int or int list

size of the core tensor, (len(ranks) == tensor.ndim) if int, the same rank is used for all modes

n_iter_maxint

maximum number of iteration

init{‘svd’, ‘random’}, optional
svdstr, default is ‘truncated_svd’

function to use to compute the SVD, acceptable values in tensorly.SVD_FUNS

tolfloat, optional

tolerance: the algorithm stops when the variation in the reconstruction error is less than the tolerance Default: 1e-8

sparsity_coefficientsarray of float (as much as the number of modes)

The sparsity coefficients are used for each factor If set to None, the algorithm is computed without sparsity Default: None

core_sparsity_coefficientarray of float. This coefficient imposes sparsity on core

when it is updated with fista. Default: None

fixed_modesarray of integers (between 0 and the number of modes)

Has to be set not to update a factor, 0 and 1 for U and V respectively Default: None

verboseboolean

Indicates whether the algorithm prints the successive reconstruction errors or not Default: False

normalize_factorsif True, aggregates the norms of the factors in the core.
return_errorsboolean

Indicates whether the algorithm should return all reconstruction errors and computation time of each iteration or not Default: False

exactIf it is True, the HALS nnls subroutines give results with high precision but it has a higher computational cost.

If it is False, the algorithm gives an approximate solution. Default: False

algorithm{‘fista’, ‘active_set’}

Non negative least square solution to update the core. Default: ‘fista’

Returns:
factorsndarray list

list of positive factors of the CP decomposition element i is of shape (tensor.shape[i], rank)

errors: list

A list of reconstruction errors at each iteration of the algorithm.

Notes

Tucker decomposes a tensor into a core tensor and list of factors:

$tensor = [| core; factors, ... ,factors[-1] |],$

We solve the following problem for each factor:

$\min_{tensor >= 0} ||tensor_i - factors[i]\times core_i \times (\prod_{i\neq j}(factors[j]))^T||^2,$

If we define two variables such as:

$\begin{split}U = core_i \times (\prod_{i \neq j}(factors[j] \times factors[j]^T)), \\ M = tensor_i,\end{split}$

$\delta = -U^TM + factors[i] \times U^TU,$

In order to calculate UTU and UTM, we define two variables:

$\begin{split}CoreCross = \prod_{i\neq j}(core_i \times (\prod_{i\neq j}(factors[j]\times factors[j]^T)) \\ TensorCross = \prod_{i\neq j} tensor_i \times factors[i],\end{split}$

Then UTU and UTM becomes:

$\begin{split}U^TU = CoreCross_j \times core_j^T, \\ U^TM = (TensorCross_j \times core_j^T)^T,\end{split}$

References



G.Kolda and B.W.Bader, “Tensor Decompositions and Applications”, SIAM REVIEW, vol. 51, n. 3, pp. 455-500, 2009.
{"ft_lang_label":"__label__en","ft_lang_prob":0.68043274,"math_prob":0.97412515,"size":3328,"snap":"2023-14-2023-23","text_gpt3_token_len":889,"char_repetition_ratio":0.12966305,"word_repetition_ratio":0.004494382,"special_character_ratio":0.25270432,"punctuation_ratio":0.14965986,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99907595,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-06-02T18:17:13Z\",\"WARC-Record-ID\":\"<urn:uuid:873ee510-1749-49b6-9de5-5a1c31723630>\",\"Content-Length\":\"23911\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:7f43668e-353d-4f0e-9198-499bd3f34458>\",\"WARC-Concurrent-To\":\"<urn:uuid:b2e5a517-adbd-4c5e-beae-8e1af42fa6bb>\",\"WARC-IP-Address\":\"185.199.109.153\",\"WARC-Target-URI\":\"http://tensorly.org/stable/modules/generated/tensorly.decomposition.non_negative_tucker_hals.html\",\"WARC-Payload-Digest\":\"sha1:RMIODVNLE2Z7VRBRWPMK3CBA7AB3YS76\",\"WARC-Block-Digest\":\"sha1:X3IYE5EC73XE6QEG2ZHKOYWLGU3GRTFM\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224648850.88_warc_CC-MAIN-20230602172755-20230602202755-00309.warc.gz\"}"}