-
Notifications
You must be signed in to change notification settings - Fork 5
/
1.4.0-DEV-81899bf99e.log
395 lines (279 loc) · 11.8 KB
/
1.4.0-DEV-81899bf99e.log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
Julia Version 1.4.0-DEV.634
Commit 81899bf99e (2019-12-18 10:13 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: Intel(R) Xeon(R) Silver 4114 CPU @ 2.20GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
Environment:
JULIA_DEPOT_PATH = ::/usr/local/share/julia
Resolving package versions...
Installed TensorToolbox ─ v1.0.1
Updating `~/.julia/environments/v1.4/Project.toml`
[9c690861] + TensorToolbox v1.0.1
Updating `~/.julia/environments/v1.4/Manifest.toml`
[9c690861] + TensorToolbox v1.0.1
[2a0f44e3] + Base64
[8ba89e20] + Distributed
[b77e0a4c] + InteractiveUtils
[8f399da3] + Libdl
[37e2e46d] + LinearAlgebra
[56ddb016] + Logging
[d6f4376e] + Markdown
[9a3f8284] + Random
[9e88b42a] + Serialization
[6462fe0b] + Sockets
[8dfed614] + Test
Testing TensorToolbox
Path `/home/pkgeval/.julia/packages/TensorToolbox/6LauI` exists and looks like the correct package. Using existing path.
Updating `/tmp/jl_geMwGX/Project.toml`
[9c690861] + TensorToolbox v1.0.1 [`~/.julia/packages/TensorToolbox/6LauI`]
Updating `/tmp/jl_geMwGX/Manifest.toml`
[9c690861] ~ TensorToolbox v1.0.1 ⇒ v1.0.1 [`~/.julia/packages/TensorToolbox/6LauI`]
Running sandbox
Status `/tmp/jl_geMwGX/Project.toml`
[9c690861] TensorToolbox v1.0.1 [`~/.julia/packages/TensorToolbox/6LauI`]
[37e2e46d] LinearAlgebra
[8dfed614] Test
**** Testing tensor.jl
**Test tensor X of size: (20, 10, 50, 5)
...Testing functions matten and tenmat (by mode).
Size of 1-mode matricization: [20, 2500]
Check if it folds back correctly: true
Size of 2-mode matricization: [10, 5000]
Check if it folds back correctly: true
Size of 3-mode matricization: [50, 1000]
Check if it folds back correctly: true
Size of 4-mode matricization: [5, 10000]
Check if it folds back correctly: true
...Testing functions matten and tenmat (by rows and columns).
Size of R=[2, 1] and C=[4, 3] matricization: [200, 250]
Check if it folds back correctly: true
...Testing function ttm.
Created 4 matrices with 5 rows and appropriate number of columns.
Size of tensor Y=ttm(X,M): (5, 5, 5, 5)
Multiplication error: 8.257766147532892e-12
...Testing function ttv.
Multiplying a tensor X by a vector v in mode 2.
Size of tensor Y=ttv(X,v): (3, 2)
...Testing function krontm.
Created two tensors X and Y of order 3 and sizes (5, 4, 3) and (2, 5, 4).
Multiplying tkron(X,Y) by random matrix in mode 3.
Multiplication error: 1.4147395618860158e-14
Multiplying tkron(X,Y) by random matrices in modes [3, 2].
Multiplication error: 1.1754530511656355e-13
Multiplying tkron(X,Y) by random matrices in all modes.
Multiplication error: 7.079623328548081e-13
...Testing function mkrontv.
Multiplying mode-1 matricized tkron(X,Y) by a random vector.
Multiplication error: 1.8460441789282214e-14
Multiplication error: 2.0145271352882748e-15
...Testing function mttkrp.
Multiplying mode-1 matricized tensor X by Khatri-Rao product of matrices.
Multiplication error: 0.0
...Testing function dropdims.
Tensor X of size :(5, 4, 1, 3, 6, 1) squeezed to size :(5, 4, 3, 6).
...Testing contraction (contract).
Error: 0.0
****Testing ttensor.jl
...Test tensor X of size: (20, 10, 50, 5)
...Testing hosvd.
Creating exact decomposition with rank = size(X):
Results:
Type of output T: ttensor
Core tensor size: (20, 10, 50, 5)
Factor matrices sizes: (20, 20) (10, 10) (50, 50) (5, 5)
...Testing function full, i.e. n-mode multiplication (ttm): norm(full(T)-X) = 1.9489244936105714e-13
...Testing ttm for ttensor T and array of matrices A : norm(full(ttm(T,A))-ttm(full(T),A)) = 7.851802661130936e-12
...Testing hosvd with smaller multilinear rank: [5, 5, 5, 5]
Results:
Type of output T: ttensor
Core tensor size: (5, 5, 5, 5)
Factor matrices sizes: (20, 5) (10, 5) (50, 5) (5, 5)
...Testing size of ttensor T : (20, 10, 50, 5)
...Testing ndims of ttensor T : 4
...Testing nrank of ttensor T for mode 1: 5
...Testing mrank of ttensor T: (5, 5, 5, 5)
...Testing functions matten and tenmat (by mode).
...Testing hosvd for tensor with noise.
For ttensor T, X=full(T) tensor of size (60, 50, 40) and rank [5, 5, 5] , N noise tensor and S=hosvd(X+N,[5, 5, 5]).
Error( norm(T-S) ): 0.014118050110568499. Noise norm: 0.1735057596597146.
...Testing hosvd with eps_abs=1e-5 on function defined tensor X of size (20, 20, 20) and multlinear rank(13, 13, 13)
Results:
Type of output T: ttensor
Core tensor size: (7, 7, 7)
Factor matrices sizes: (20, 7) (20, 7) (20, 7)
...Testing hosvd with eps_rel=1e-5 on function defined tensor X of size (20, 20, 20)
Results:
Type of output T: ttensor
Core tensor size: (6, 6, 6)
Factor matrices sizes: (20, 6) (20, 6) (20, 6)
...Testing if factor matrices of ttensor T are orthogonal: true
...Recompress Tucker tensor T to smaller rank: [3, 3, 3]
Results:
Type of output T: ttensor
Core tensor size: (3, 3, 3)
Factor matrices sizes: (20, 3) (20, 3) (20, 3)
...Testing orthogonal flag and reorthogonalization for random ttensor S of size (4, 5, 2).
Has orthogonal factor matrices: false
After reorthogonalization: true
...Testing norm of ttensor T.
|norm(T) - norm(full(T))| = 0.0
...Testing scalar multiplication 3*T.
norm(full(3*T) - 3*full(T)) = 2.762916642284124e-14
...Creating two random ttensors X and Y of size (6, 8, 2, 5, 4).
...Testing addition.
norm(full(X+Y) - (full(X)+full(Y))) = 1.587652187221508e-13
...Testing inner product.
|innerprod(X,Y) - innerprod(full(X),full(Y))| = 3.183231456205249e-12
...Testing Hadamard product.
norm(full(ewprod(X,Y)) - full(X).*full(Y)) = 1.927139621848672e-12
...Testing singular values of matricizations of Tucker Tensor.
Singular values of matricizations of random Tucker tensor of size (10, 9, 8), rank [3, 3, 3] and norm 135.7045025349841.
Mode-1 singular values error: 2.2748467065386707e-14
Mode-2 singular values error: 7.685694801574505e-14
Mode-3 singular values error: 6.031771294470064e-14
Singular values of matricizations of random Tucker tensor of size (20, 20, 20, 20), rank [5, 5, 5, 5] and norm 12032.08599325831.
Mode-1 singular values error: 2.227797943108433e-12
Mode-2 singular values error: 8.531816565343306e-12
Mode-3 singular values error: 7.797292800879517e-12
Mode-4 singular values error: 5.697967974875459e-12
...Testing function mhadtv.
...Creating two random ttensors X and Y of size (5, 4, 3).
Multiplying mode-1 matricized ewprod(X,Y) by a random vector.
Multiplication error: 9.230220894641107e-15
Multiplication error: 7.938870967844446e-15
Multiplication error: 1.503935499763765e-13
...Testing function mttkrp.
Multiplying mode-1 matricized tensor X by Khatri-Rao product of matrices.
Multiplication error: 1.0250792055532469e-14
...Testing cp_als on ttensor.
Test rank-1 ttensor T of size: (5, 4, 3)
norm(full(Tcp)-T) = 1.7303594940867284e-16
****Testing ktensor.jl
**Test rank-1 tensor X of size: (5, 4, 3)
...Testing cp_als.
norm(full(Xcp)-X) = 4.9742723046205475e-16
**Test ktensors X and Y of size: (4, 3, 2)
...Testing function ndims.
X is of order: 3
...Testing function ttensor and full.
...Testing scalar multiplication.
norm(full(3*X) - 3*full(X)) = 1.3866681133119837e-15
...Testing functions plus and minus.
norm(full(Z)-(full(X)+full(Y))) = 5.985173094038516e-16
norm(full(Z)-(full(X)-full(Y))) = 6.288055556753913e-16
...Testing function innerprod.
norm(innerprod(X,Y)-innerprod(full(X),full(Y))) = 5.273559366969494e-16
...Testing function norm.
...Testing functions arrange and arrange!.
norm(full(X)-full(Z)) = 1.1697748610254586e-15
...Testing functions normalize and normalize!.
norm(full(X)-full(Z)) = 7.239098962355515e-16
...Testing functions redistribute and redistribute!.
norm(full(X)-full(Z)) = 7.110250420355457e-16
...Testing functions fixsigns, fixsigns! and isequal.
norm(full(X)-full(Z)) = 0.0
...Testing functions ttm and ttv.
...Testing function tocell.
Is the output MatrixCell: true
...Testing function tenmat by mode 2.
...Testing function mttkrp.
Multiplying mode-1 matricized tensor X by Khatri-Rao product of matrices.
Multiplication error: 1.929676952183718e-15
****Testing dimtree.jl
...Testing creating a dimtree.
...Testing function non (number-of-nodes).
...Created two dimtrees for tensor of order 5, with 9 nodes.
...Testing functions:
- height
- children
- sibling
- parent
- is_leaf
- is_left
- is_right
- count_leaves
- dims
- lvl
- nodes_on_lvl
- node2ind
- subnodes
- left_child_length
Testing truncation of tensor X of size (2, 2, 2, 2, 2) to htensor.
norm(full(H)-X) = 9.642055270146469e-14
norm(full(H)-X) = 9.324974611567615e-14
...Testing size of htensor H : (5, 4, 3, 2, 4, 2)
...Testing ndims of htensor H : 6
...Testing ttm for ttensor H and array of matrices A : norm(full(ttm(H,A))-ttm(full(H),A)) = 6.286540713293258e-13
...Testing norm of htensor H.
|norm(H) - norm(full(H))| = 1.0658141036401503e-14
...Testing scalar multiplication 3*H.
norm(full(3*H) - 3*full(H)) = 1.9250739382117315e-14
Testing functions plus and minus for htensors H1 and H2.
norm(full(H1+H2) - (full(H1)+full(H2))) = 1.0934428697813141e-15
norm(full(H1+H2) - (full(H1)+full(H2))) = 8.993834424997154e-16
...Testing inner product.
|innerprod(H1,H2) - innerprod(full(H1),full(H2))| = 3.552713678800501e-15
Testing function dropdims for squeezed tensor X and squeezed htensor Y.
norm(full(Y)-dropdims(X,dims=1)) = 4.866653478941815e-15
norm(full(Y)-dropdims(X,dims=2)) = 2.7240086067659812e-15
norm(full(Y)-dropdims(X,dims=3)) = 5.745487954890486e-15
norm(full(Y)-dropdims(X,dims=4)) = 1.0031272156041913e-14
norm(full(Y)-dropdims(X,dims=5)) = 6.840170186389644e-15
...Testing reorthogonalization for random htensor H of size (4, 5, 2).
Has orthogonal factor matrices: false
After reorthogonalization: true
Testing hrank: [1, 2, 2, 2, 2]
****Testing TTtensor.jl
...Test core tensors G of sizes:
(1, 4, 3)
(3, 6, 4)
(4, 3, 1)
...Test size of TTtensor T: (4, 6, 3)
...Test ndims of TTtensor T: 3
...Test TTsvd of TTtensor T: (3, 4)
...Test addition:
...Test dot product:
...Test tensor X of size: (5, 4, 3, 2)
...Testing TTsvd.
Results:
Type of output T: TTtensor
...Testing function full, i.e. contracted product (conprod): norm(full(T)-X) = 4.711639334659628e-15
...Testing TTsvd with requested rank.
Created tensor x of size (6, 5, 6, 5), with TTrank = (4, 4, 4).
T1=TTsvd(X,reqrank=[4, 4, 4])
norm(X-full(T1)) = 6.731504770259503e-14
...Testing recompression.
S=TTsvd(T): norm(full(S)-X) = 1.1923423136870762e-13
...Testing reorthogonalization - function reorth.
Test TT-tensor T of size: (6, 5, 4, 3) with flags T.lorth = false and T.rorth = false.
Performing (default) left orthogonalization: Tl=reorth(T).
Flags: Tl.lorth = true, Tl.rorth = false.
Performing right orthogonalization: Tr=reorth(T,"right").
Flags: Tr.lorth = false, Tr.rorth = true.
norm(Diagonal(ones(size(Gn, 1))) - Gn * Gn') = 6.308143205892833e-16
norm(Diagonal(ones(size(Gn, 1))) - Gn * Gn') = 4.127941799363053e-16
...Testing reorthogonalization with overwriting - function reorth!.
Performing (default) left orthogonalization: reorth!(T)
Flags: T.lorth = true, T.rorth = false.
Performing right orthogonalization: reorth!(T,"right")
Flags: T.lorth = true, T.rorth = true.
...Testing TTsvd on TT-tensors.
Fixed precision problem with ϵ = 1.0e-8.
Created TT-tensor T of size (6, 5, 6, 5), with TTrank = (4, 4, 4), but its actual TT-rank is (2,2,2)
T1=TTsvd(T,ϵ)
TTrank(T1) = (2, 2, 2)
norm(full(T)-full(T1)) = 9.904241048541667e-14
Fixed rank problem with reqrank = [2, 2, 2].
Created TT-tensor T of size (6, 5, 4, 3), with TTrank = (6, 12, 3).
T1=TTsvd(T,reqrank=[2, 2, 2])
TTrank(T1) = (2, 2, 2)
... Testing contraction with vectors - function TTtv.
... Testing transformation of ktensor to TTtensor - function kten2TT.
Test ktensor T of size (5, 4, 3, 2), and k-rank = 3, transofrming to TTtensor Ttt.
norm(full(T)-full(Ttt)) = 0.0
... Testing contraction of full tensor to TTtensor - function contract.
... Testing element-wise product of two TTtensor - function ewprod.
Testing TensorToolbox tests passed