When the index is a tuple

The penalty walks the same curve

A rank-two fit to a random 2 × 2 × 2 tensor of rank three has no best answer: its error falls towards the tensor's distance to the boundary along a law, d + C/s², while its terms grow without limit. A penalty on the term sizes restores a best answer, and the prediction was that its error at terms three times the tensor's norm would sit within ten per cent of the law's d + C/9 — on the assumption, unproved, that the unbounded fit's path is already the best trade between size and error. On twelve tensors the penalised fit's error at that size is within 1.1 per cent of the law, and every penalised fit with terms past two and a half times the norm lies on the same curve. The assumption holds as far as a penalty can test it. And the penalised fit needs tens of thousands of sweeps to settle where the unbounded fit arrives in at most 144, so the cheap way to a bounded fit is to stop the unbounded one when its error reaches the law's price — not when its terms reach the bound, which on four tensors of twelve happens before the fit has found the boundary at all.

Worth reading first: A nearest point that is not there · An iteration that walks out of the set.

A stop that knows the distance fitted rank-two decompositions to random 2 × 2 × 2 tensors of rank three — tensors whose slice pencil has a complex pair of eigenvalues, so that no rank-two tensor is nearest to them. Alternating least squares on such a tensor settles at its distance dd to the boundary of the rank-two set while its two terms grow without limit, cancelling each other more and more exactly, and the error approaches dd along a law: at terms of size ss times the tensor’s norm the error is d+C/s2d + C/s^2, with CC between 0.015 and 0.05 on every draw.

It priced a bounded alternative from that law, on an assumption it marked as such: if a fit constrained to terms no larger than ss “can do no better than that — if the fit’s own path is the best trade between size and error, which nothing here proves — then a bound of three times the norm costs an excess of about C/9C/9”. Its last section turned that into a prediction. “Add a penalty on the term sizes to the least-squares objective and the fit has a best answer again. The prediction is that the penalised fit’s error at a term bound of three times the norm sits within ten per cent of d+C/9d + C/9, the unconstrained law’s value at that size, so that the law prices the bounded alternative before it is run.”

It does, to a tenth of the margin the prediction allowed. The more useful result is what that says about the assumption, and what it says about how to get a bounded fit.

The tensors are the earlier essay’s: the first twelve of its draws whose fit reached one per cent of the distance, each with its distance dd computed from the boundary’s equation rather than from any fit, and its constant CC read from where its unbounded fit crossed one per cent. Their distances run from 0.023 to 0.21 of the tensor’s norm and their constants from 0.029 to 0.044. The rank that stops being typical counted how common such tensors are — a random 2 × 2 × 2 tensor has this problem with probability 1−π/41 - \pi/4, about one draw in five — so this is not a corner case of the shape but a fifth of it.

A penalty that makes a best answer

The objective is the least-squares error plus μ\mu times the sum of the squared norms of every column of the three factor matrices, with μ\mu fixed, so the penalised problem has a minimiser: terms that grow without limit pay without limit. Alternating least squares descends it exactly, each mode’s update solving its small normal equations with μ\mu added to the diagonal. At a minimiser the three columns of each term have equal norms — any imbalance could be removed by rescaling at a saving — so a term of size ss pays 3μs2/33\mu s^{2/3}, and two terms of nearly equal size, as a diverging fit’s two always are, pay 6μs2/36\mu s^{2/3}.

That gives the penalty’s strength for a target size before anything is run. Near the boundary the squared error is about d2+2dC/s2d^2 + 2dC/s^2; adding the penalty and setting the derivative in ss to zero balances 4dC/s34dC/s^3 against 4μs−1/34\mu s^{-1/3}, so

s8/3=dCμ,μ3=dC38/3s^{8/3} = \frac{dC}{\mu}, \qquad \mu_3 = \frac{dC}{3^{8/3}}

is the penalty that should give terms three times the norm. On the twelve tensors it runs from 4.8×10−54.8 \times 10^{-5} to 4.1×10−44.1 \times 10^{-4}, set by each tensor’s own dd and CC from the earlier essay. Each fit is run at four, two, one, a half and a quarter times that μ3\mu_3, started from the unbounded fit’s factors at the sweep where its terms first reach three times the norm.

The error at three times the norm

The penalised fit's error at terms three times the norm, over the unbounded law's d + C/9, for twelve random 2 × 2 × 2 tensorsseed 202: 0.18029 against 0.18005, ratio 1.0014; seed 203: 0.05443 against 0.05409, ratio 1.0062; seed 209: 0.02777 against 0.02747, ratio 1.0108; seed 213: 0.19861 against 0.19834, ratio 1.0014; seed 215: 0.08126 against 0.08097, ratio 1.0036; seed 223: 0.21392 against 0.21379, ratio 1.0006; seed 234: 0.14114 against 0.14074, ratio 1.0028; seed 236: 0.07823 against 0.07800, ratio 1.0030; seed 244: 0.10643 against 0.10624, ratio 1.0017; seed 252: 0.15462 against 0.15481, ratio 0.9987; seed 257: 0.05075 against 0.05025, ratio 1.0101; seed 262: 0.09007 against 0.08977, ratio 1.0033. Interpolated in log size between the two penalised fits either side of size three.error ÷ law at size threelargest ratio1smallest10.980.9911.011.021.03error ÷ (d + C/9)202203209213215223234236244252257262dashed: exactly the law · the prediction allowed 0.9 to 1.1priced before it was run
Fig. 1 The penalised fit’s error at terms three times the tensor’s norm over the unbounded law’s d + C/9, for each of twelve tensors.

Interpolated between the two penalised fits either side of size three, the error is between 0.9987 and 1.0108 times d+C/9d + C/9 on all twelve tensors. The prediction allowed 0.9 to 1.1. Measured as excess over the distance — the price of the bound itself, C/9C/9 by the law — the penalised fits pay between 0.94 and 1.13 times what the law charges, which is the same agreement seen at higher magnification, since the excess is a few per cent of the error.

The closest tensor to the boundary measured, at distance 0.023, pays an excess of 0.0046 of the norm, a fifth of its distance; the farthest, at 0.21, pays 0.0035, under two per cent of it. That is the earlier essay’s observation in a second currency: the same quantity, C/dC/d, prices a near-boundary tensor’s bound in error as it priced its stop in size.

Every fit on one curve

Every penalised rank-two fit's error above the tensor's distance to the boundary, in units of that draw's own constant, against its largest term's size, for twelve random 2 × 2 × 2 tensorsTwelve draws, five penalties each, at 4, 2, 1, ½ and ¼ times the penalty the balance argument predicts for terms three times the norm. The line is the unbounded fit's law, (error − d)/C = 1/s². seed 202: 1.61 → 0.429, 2.00 → 0.266, 2.52 → 0.163, 3.21 → 0.099, 4.12 → 0.059; seed 203: 1.68 → 0.428, 2.03 → 0.275, 2.51 → 0.173, 3.15 → 0.107, 3.99 → 0.065; seed 209: 1.86 → 0.322, 2.25 → 0.213, 2.77 → 0.137, 3.45 → 0.087, 4.36 → 0.054; seed 213: 1.57 → 0.526, 1.91 → 0.327, 2.36 → 0.200, 2.96 → 0.121, 3.74 → 0.073; seed 215: 1.89 → 0.322, 2.34 → 0.202, 2.93 → 0.124, 3.71 → 0.075, 4.73 → 0.045; seed 223: 1.58 → 0.434, 1.98 → 0.266, 2.51 → 0.162, 3.21 → 0.097, 4.12 → 0.058; seed 234: 1.79 → 0.420, 2.17 → 0.259, 2.67 → 0.158, 3.33 → 0.095, 4.19 → 0.057; seed 236: 1.66 → 0.395, 2.05 → 0.251, 2.57 → 0.156, 3.26 → 0.096, 4.17 → 0.058; seed 244: 1.88 → 0.314, 2.34 → 0.195, 2.95 → 0.119, 3.76 → 0.072, 4.82 → 0.043; seed 252: 1.77 → 0.333, 2.18 → 0.204, 2.73 → 0.124, 3.46 → 0.075, 4.40 → 0.045; seed 257: 1.69 → 0.447, 2.02 → 0.293, 2.46 → 0.187, 3.05 → 0.117, 3.83 → 0.072; seed 262: 1.66 → 0.453, 2.02 → 0.285, 2.51 → 0.176, 3.15 → 0.107, 3.99 → 0.065.110¹10⁻²10⁻¹110¹largest term ÷ tensor's norm(error − distance) ÷ C4 × the balance μ2 × the balance μ1 × the balance μ0.5 × the balance μ0.25 × the balance μdashed: the unbounded fit's law · dotted: size threethe penalty walks the same curve
Fig. 2 Every penalised fit’s error above the distance, in units of its tensor’s own constant C, against its largest term’s size over the tensor’s norm. The dashed line is the unbounded fit’s law, 1/s².

The figure at the top of the page puts all sixty penalised fits on one pair of axes by dividing each tensor’s excess by its own constant. The unbounded law is then the single line 1/s21/s^2, and the fits lie along it. Past two and a half times the norm every one of them is within fifteen per cent of the line in excess, which is within about one per cent in error; the strongest penalties, which hold the terms under two, sit above the line by up to a third. The law was fitted on the unbounded path at sizes of three and more, and it is an asymptote: below two it under-prices the penalised fits’ excess.

A random 2 × 2 × 2 tensor of rank three, seed 209: the unbounded rank-two fit's path and the penalised fits, as error above the distance to the boundary against term sizeDistance 0.0232, constant 0.0384. Unbounded path, at sweeps 10, 30, 100, 300, 1000, 3000, 10000, 20000: sizes 2.19, 2.25, 2.95, 3.40, 4.58, 6.82, 11.54, 15.97, excess 1.4e+1, 1.4e+1, 2.0e-1, 1.5e-1, 8.0e-2, 3.6e-2, 1.2e-2, 6.5e-3. Penalised: μ×4 size 1.86 excess 5.32e-1 after 39062 sweeps; μ×2 size 2.25 excess 3.52e-1 after 40001 sweeps; μ×1 size 2.77 excess 2.27e-1 after 40001 sweeps; μ×0.5 size 3.45 excess 1.43e-1 after 40001 sweeps; μ×0.25 size 4.36 excess 8.88e-2 after 40001 sweeps.seed 209error at size three0.028d + C/90.027110¹10⁻⁴10⁻³10⁻²10⁻¹1largest term ÷ tensor's normerror ÷ distance − 1unbounded pathpenalised fitsthe lawdashed: C/(d s²)one curve, two ways along it
Fig. 3 One tensor’s unbounded fit, sampled along its run, and its penalised fits, as error above the distance against term size, with the law through them. The dial chooses the tensor.

On a single tensor the picture is plainer, and it shows one thing the collapsed figure cannot. The unbounded path’s first samples, ten and thirty sweeps in, sit far above the law: the fit has not yet found the boundary, and its terms are already more than twice the norm. From there it joins the law and runs down it as its terms grow. The five penalised fits sit on the law at the sizes their penalties hold them to — the larger three on the path itself, the two strongest below the path’s early sweeps, on the law’s continuation where the path never was. The dial moves between a tensor far from the boundary, one at middling distance and one close to it. They differ in how high the curve sits — the closer tensor’s excess is larger at every size, by the factor 1/d1/d — and not in whether the penalised fits lie on it.

That is the assumption the earlier essay could not prove, tested in the only way a penalty can test it. A penalised minimiser at strength μ\mu is the best trade between error and size that the penalty can find near where it was started: if a point of smaller error at the same size existed nearby, the penalty would go there. It finds the path. Within the reach of this search, the unbounded fit’s own trajectory is the best trade between size and error once it has joined its law, and a bound on the terms past that point buys exactly the error the trajectory had at that size. Before it has joined — at the first few dozen sweeps on some tensors — the trajectory is worse than the best trade, and a penalty does better than stopping there would.

What the balance argument gets right

The penalised fit's largest term against the size the balance argument predicts from the penalty, every fit on twelve drawsThe prediction balances the law's 2dC/s² against two equal terms' penalty 6μs²ᐟ³, giving s = (dC/μ)³ᐟ⁸. Measured over predicted: from 0.741 to 1.061.123456123456size the balance predicts from the penaltymeasured size4 × the balance μ2 × the balance μ1 × the balance μ0.5 × the balance μ0.25 × the balance μdashed: measured equals predictedthe balance runs a little large
Fig. 4 Each penalised fit’s largest term against the size the balance argument predicts from its penalty, every fit on twelve tensors.

The balance predicts the size from the penalty to within about a quarter: measured over predicted between 0.74 and 1.06 at every strength. It runs high at the weaker penalties — the fits at the balance μ3\mu_3 itself reach 2.4 to 3.0 times the norm rather than 3 — and the sizes fall as μ\mu to a power between −0.30-0.30 and −0.35-0.35 per tensor rather than the −3/8-3/8 the argument gives. Both departures have the same source: the balance used the law, which under-prices the excess at small sizes, so it over-states how much error a little more size would save. That is also why the error at size three was interpolated between fits rather than read off the fit at μ3\mu_3.

The price in sweeps

Sweeps of alternating least squares: the unbounded fit until its terms reach three times the norm, and the penalised fit started there until it settles, at the balance penaltyseed 202: 17 unbounded, 26304 penalised; seed 203: 1 unbounded, more than 40000 penalised; seed 209: 121 unbounded, more than 40000 penalised; seed 213: 8 unbounded, 21096 penalised; seed 215: 144 unbounded, more than 40000 penalised; seed 223: 65 unbounded, 31288 penalised; seed 234: 37 unbounded, more than 40000 penalised; seed 236: 79 unbounded, more than 40000 penalised; seed 244: 127 unbounded, more than 40000 penalised; seed 252: 1 unbounded, more than 40000 penalised; seed 257: 126 unbounded, more than 40000 penalised; seed 262: 58 unbounded, more than 40000 penalised. Penalised runs stop when the objective changes by less than 10⁻¹⁵ of itself or at 40000 sweeps.sweepsunbounded, most144penalised, fewest2.1·10⁴110¹10²10³10⁴10⁵sweeps202203209213215223234236244252257262unbounded, to size threepenalised, to settledotted: the sweep limitstopping is the cheap bound
Fig. 5 Sweeps of alternating least squares on each tensor: the unbounded fit until its terms reach three times the norm, and the penalised fit started there, at the balance penalty, until it settles. The dotted line is the limit of 40,000 sweeps.

A bounded fit has a best answer, and on these tensors it is expensive to find. The unbounded fit reaches terms three times the norm within 144 sweeps on every tensor — on two of them within the first sweep. The penalised fit started from that point, at the balance penalty, settles on three of the twelve, after 21,096 to 31,288 sweeps, and on the other nine is still moving after 40,000. It moves slowly because it is in the swamp the earlier essays measured: two nearly cancelling terms, a nearly singular normal matrix in every update, and a penalty small enough not to spoil the fit, which is also small enough to give the iteration almost no curvature to descend.

An iteration that walks out of the set made the point that every sweep of alternating least squares is the exact minimiser of its own subproblem, so the objective can only fall, and that a plateau at a small residual looks identical to slow convergence unless the size of the terms is plotted beside it. The penalised runs are the converse case: an objective that has a minimum, approached so slowly that after 40,000 sweeps the runs that have not settled are still changing their objective by more than a part in 101510^{15} a sweep — the test this essay used to call a run settled — and nothing in the objective’s history says how much further they have to go. A fit that has an answer and cannot stop found the same thing with a spare term on a noisy tensor: an answer exists, the iteration cannot certify it has reached it, and the stopping test has to be about the quantity the caller wants rather than about the objective.

That makes the practical comparison stark, with one correction the measurement forced. A bounded fit’s error is the unbounded path’s error at the same size once the path has joined its law, and the unbounded path gets there two to four orders of magnitude sooner. But the obvious way to use that — run the unbounded fit and stop at the first sweep whose largest term passes three times the norm — fails on four of the twelve tensors. On those the terms pass three during the first few sweeps, before the fit has found the boundary at all, and the error there is fifteen to seventy-seven times further above the distance than the law’s C/9C/9. The size is the wrong thing to watch early in a run.

The error is the right one. Stopped at the first sweep whose error is within C/9C/9 of the distance — the earlier essay’s stop, with its tolerance set to the bound’s price — the unbounded fit stops within 157 sweeps on every tensor, with terms between 3.0 and 4.3 times the norm. That is the bounded fit’s answer at the bounded fit’s error, with terms a little larger than the bound on the tensors whose path joined its law late, for one sweep for every few hundred the penalised fit spends deciding where to settle. The penalty is the principled formulation and the error stop is the efficient one, and past the transient they give the same number.

Where the law under-prices

Each penalised fit's error above the distance, over what the unbounded law says for its size, against the sizeSixty fits on twelve draws. Past two and a half times the norm the ratio runs from 0.867 to 1.124; below two, from 1.039 to 1.341.23450.80.911.11.21.31.4largest term ÷ tensor's normexcess ÷ the law's excess4 × the balance μ2 × the balance μ1 × the balance μ0.5 × the balance μ0.25 × the balance μdotted: two and a half times the norman asymptote, accurate from about there
Fig. 6 Each penalised fit’s excess over the distance, over what the unbounded law says for its size, against the size. The dotted line is two and a half times the norm.

The strongest penalties hold the terms near one and a half to two times the norm, and there the law is too optimistic: the excess is up to 34 per cent above C/s2C/s^2, on most tensors by ten to thirty. That is not a failure of the penalised fits, which are the best trade the penalty can find at that size, but of the law, which is the leading term of an expansion in 1/s1/s and has nothing to say about where the next term starts to matter. Past two and a half the ratio is within fifteen per cent of one on every fit.

For pricing a bound, the consequence is a floor under the bound itself. A bound of three or more is priced by C/s2C/s^2 to within a few per cent of the error. A bound of one and a half is priced only roughly, and a fit held that tightly is no longer close to the boundary in any useful sense — its error is half again the distance on the tensors nearest the boundary.

What this says about a fit with no answer

A fit with no answer to find found that half of random 3 × 3 × 2 tensors and most larger ones have no best decomposition of the rank they are asked for, and a nearest point that is not there gave the reason: the set of tensors of rank at most two is not closed. Every remedy for that — a penalty, a bound, a stop — is a way of choosing a point at a finite distance along a path that would otherwise run off to infinity. This measurement says that on 2 × 2 × 2 tensors the remedies agree about which point: the penalty at a given strength, the bound at a given size, and the stop at a given sweep all land on the one curve the unbounded fit traces, and the only real choice is how far along it to go. How far is a trade between the size of the terms, which the caller may need small for the factors to mean anything, and the error, which the law prices.

A rank that is not a property of the tensor showed that the same eight numbers have rank three over the reals and two over the complexes; in the complexes these tensors would have an exact rank-two decomposition and no swamp. The penalty is the real fit’s way of approaching an answer that exists only one field over, and the curve is how close it can come at each size.

A penalty is a regularisation, priced the usual way

The construction will be familiar from a different part of numerical linear algebra. A least-squares problem whose answer is unstable, plus a penalty on the answer’s size with a parameter to choose, is Tikhonov regularisation, and the question of what the parameter costs is the one the floor is the part the noise buried and the essays before it asked of deconvolution. The analogy is closer than it looks. There the penalised solution’s error had a floor set by what the data could not say, and every penalty landed on that floor; here the penalised fit’s error has a floor set by the distance to the boundary, and every penalty lands on the curve that approaches it. In both, the penalty does not create a better answer than the unpenalised iteration passes through. It chooses where along that iteration to be, and the parameter is a way of naming the point.

What differs is the cost of finding the point. A linear Tikhonov problem is one solve at each parameter, and the earlier essays swept hundreds of parameters for the price of one factorisation. A penalised CP fit is a nonlinear iteration that has to be run to convergence at each parameter, and near the boundary that convergence takes thousands of times longer than the unpenalised iteration takes to pass the same point. The regularisation is sound and the computation is the wrong way round: the cheap path is to run the unregularised iteration and read the regularised answers off it as it passes.

What twelve small tensors do not show

Every tensor is 2 × 2 × 2, where the boundary’s distance is a closed-form computation; the law’s constant comes from the earlier essay’s own fits. The penalised fits were started from the unbounded path, so a penalised minimiser far from that path, if one exists, was not looked for; the claim is that the path is the best trade in its own neighbourhood. Nine of the twelve penalised fits at the balance strength had not settled after 40,000 sweeps; their reported points are where they were, on the curve, but not certainly where they would end.

Still open: a start away from the path, and three slices

Penalised from random starts. Every penalised fit here began on the unbounded path. The prediction with a sign is that from twenty random starts at the balance strength, every run that settles does so within five per cent of the same error as the path-started fit, so that the curve is the only trade there is rather than the nearest one — and that at least half of those runs do not settle within 40,000 sweeps.

Three slices. On 3 × 3 × 2 tensors with a complex pair the earlier essays found the same floor at the distance to the boundary, computed without fitting. The prediction is that the same law holds there with CC in the same range, so that a bound of three times the norm costs within two per cent of d+C/9d + C/9 in error on every such tensor whose distance can be computed.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A flat tag is an object no other essay names yet.

Alternating least squaresBorder-rankDegeneracyRegularisationStopping criterionTensor rank