{"id":"wavelet_embedding_distance","title":"Coarse Haar coefficients embedding distance","family":"embedding","definition":"reference","intro_en":"Recursively average and difference adjacent pairs with orthonormal Haar scaling. Keep the coarsest average and the next three detail levels: eight of the 16 coefficients. Comparing this vector emphasizes retained scales while deliberately discarding the finest eight detail coefficients. Euclidean distance retains differences in both vector scale and coordinates.","intro_zh":"对相邻点反复计算带正交归一化的和与差。本例保留最粗近似及随后三级细节，共 16 个系数中的八个；比较这些坐标强调所保留尺度，并主动舍弃最细的八个细节系数。 欧氏距离同时保留向量尺度与坐标差异。","steps_en":["Apply Haar pair averages/differences recursively and retain [A4,D4,D3,D2].","Collect the computed coordinates in the same fixed order for both inputs.","Take the Euclidean norm of the coordinate differences.","Interpret the score in this representation, accounting for the information it discards."],"steps_zh":["递归计算 Haar 相邻点和差，保留 [A4,D4,D3,D2]。","把计算得到的坐标按同一个固定顺序组成两个向量。","对坐标差计算欧氏范数。","结合表示所舍弃的信息，在该表示空间中解释分数。"],"animation_steps_en":["Compute Haar coefficients and retain the eight coarsest coordinates.","Collect matching coordinates in the same vector order.","Take the Euclidean norm of coordinate differences.","Read the score in this feature space, with its stated information loss."],"formula":"d(x,y) = sqrt(sum_j (phi_j(x)-phi_j(y))^2)","caveats_en":["This is a truncated transform; different high-frequency details can produce exactly the same retained vector.","Haar coefficients depend on alignment and boundary handling. Here the length is a power of two and no padding is needed.","A metric on these feature vectors can be only a pseudometric on the original series when the representation loses information."],"caveats_zh":["这里使用截断变换；不同的高频细节可能产生完全相同的保留向量。","Haar 系数依赖对齐与边界处理。本例长度为二的幂，因此无需填充。","当表示损失信息时，特征空间中的度量在原序列空间上可能只是伪度量。"],"sources":[{"label":"PyWavelets: Haar approximation and detail coefficients","url":"https://pywavelets.readthedocs.io/en/latest/ref/dwt-discrete-wavelet-transform.html"},{"label":"Imported registry: named feature and comparison conventions","url":"https://github.com/ZipengWu365/EchoTime/blob/main/src/echotime/data/ts_similarity_package_v2_registry.csv"},{"label":"Exact illustrative inputs and encoder definitions","url":"https://github.com/ZipengWu365/EchoTime/blob/main/tools/method_animation_data/feature_model_embedding.py"}],"x":[0.0,0.8769216919004693,0.8094744111674236,0.7863961030678929,0.3905255888325767,-0.5769216919004693,-0.6000000000000001,-0.09587051423531628,0.2094744111674235,1.0863961030678926,1.5905255888325764,0.9958705142353173,0.6000000000000002,0.20412948576468337,-0.39052558883257615,0.11360389693210537],"y":[-0.2003300858899106,0.185,0.5703300858899106,1.005,1.0003300858899107,0.3250000000000002,-0.35033008588991066,-0.3550000000000001,0.07966991411008931,0.46499999999999997,0.8503300858899105,1.2849999999999995,1.2803300858899114,0.6050000000000002,-0.07033008588991083,-0.07500000000000043],"input_label":"Deterministic synthetic teaching signals, 16 samples each","parameters":{"wavelet":"orthonormal Haar","length":16,"coefficient_order":"A4,D4,D3,D2,D1","retained":8,"boundary":"no padding","comparison":"euclidean"},"result":{"label":"distance","value":1.5868230336128186,"detail":"Computed from the explicitly defined illustrative encoder; no learned weights."},"frames":[{"phase":0,"caption":"Haar level 1: pair sums form the next approximation.","panel":{"kind":"bars","title":"Level 1 approximation coefficients","a":[0.6200772749124022,1.1284508625114549,-0.13180194846605345,-0.4920547594435621,0.9163188281554904,1.828858223313768,0.568605412336259,-0.1958132062004747],"a_label":"x approximation","b":[-0.010840007688928002,1.113926586339942,0.9371498910433054,-0.49874368670764585,0.3851397897755385,1.5099063838044082,1.3331296885077724,-0.10276388924317963],"b_label":"y approximation"}},{"phase":0,"caption":"Haar level 1: pair differences record detail at this scale.","panel":{"kind":"bars","title":"Level 1 detail coefficients","a":[-0.6200772749124022,0.016318828155490586,0.6840885326468223,-0.356473377980295,-0.620077274912402,0.4204846357147142,0.2799227250875982,-0.3564733779802934],"a_label":"x detail","b":[-0.27246951672795056,-0.30735804384501825,0.4775304832720493,0.0033021279348029804,-0.2724695167279506,-0.307358043845018,0.4775304832720497,0.0033021279348030984],"b_label":"y detail"}},{"phase":0,"caption":"Haar level 2: pair sums form the next approximation.","panel":{"kind":"bars","title":"Level 2 approximation coefficients","a":[1.2363961030678927,-0.4411333086516044,1.9411333086516043,0.26360389693210634],"a_label":"x approximation","b":[0.7799999999999998,0.31,1.3399999999999994,0.8699999999999999],"b_label":"y approximation"}},{"phase":0,"caption":"Haar level 2: pair differences record detail at this scale.","panel":{"kind":"bars","title":"Level 2 detail coefficients","a":[-0.3594744111674235,0.2547372055837118,-0.6452627944162886,0.5405255888325771],"a_label":"x detail","b":[-0.7953300858899103,1.0153300858899106,-0.7953300858899103,1.0153300858899112],"b_label":"y detail"}},{"phase":0,"caption":"Haar level 3: pair sums form the next approximation.","panel":{"kind":"bars","title":"Level 3 approximation coefficients","a":[0.5623357147571206,1.558984628802521],"a_label":"x approximation","b":[0.7707463914933367,1.5627059864222692],"b_label":"y approximation"}},{"phase":0,"caption":"Haar level 4: pair sums form the next approximation.","panel":{"kind":"bars","title":"Level 4 approximation coefficients","a":[1.4999999999999996],"a_label":"x approximation","b":[1.6499999999999992],"b_label":"y approximation"}},{"phase":1,"caption":"Expose 1 of 8 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[1.4999999999999996],"a_label":"x features","b":[1.6499999999999992],"b_label":"y features","labels":["A4"],"marker":0}},{"phase":1,"caption":"Expose 2 of 8 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[1.4999999999999996,-0.7047372055837111],"a_label":"x features","b":[1.6499999999999992,-0.5599999999999995],"b_label":"y features","labels":["A4","D4"],"marker":1}},{"phase":1,"caption":"Expose 3 of 8 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[1.4999999999999996,-0.7047372055837111,1.186192422666736],"a_label":"x features","b":[1.6499999999999992,-0.5599999999999995,0.33234018715767716],"b_label":"y features","labels":["A4","D4","D3a"],"marker":2}},{"phase":1,"caption":"Expose 5 of 8 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[1.4999999999999996,-0.7047372055837111,1.186192422666736,1.1861924226667366,-0.3594744111674235],"a_label":"x features","b":[1.6499999999999992,-0.5599999999999995,0.33234018715767716,0.332340187157677,-0.7953300858899103],"b_label":"y features","labels":["A4","D4","D3a","D3b","D2a"],"marker":4}},{"phase":1,"caption":"Expose 6 of 8 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[1.4999999999999996,-0.7047372055837111,1.186192422666736,1.1861924226667366,-0.3594744111674235,0.2547372055837118],"a_label":"x features","b":[1.6499999999999992,-0.5599999999999995,0.33234018715767716,0.332340187157677,-0.7953300858899103,1.0153300858899106],"b_label":"y features","labels":["A4","D4","D3a","D3b","D2a","D2b"],"marker":5}},{"phase":1,"caption":"Expose 8 of 8 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[1.4999999999999996,-0.7047372055837111,1.186192422666736,1.1861924226667366,-0.3594744111674235,0.2547372055837118,-0.6452627944162886,0.5405255888325771],"a_label":"x features","b":[1.6499999999999992,-0.5599999999999995,0.33234018715767716,0.332340187157677,-0.7953300858899103,1.0153300858899106,-0.7953300858899103,1.0153300858899112],"b_label":"y features","labels":["A4","D4","D3a","D3b","D2a","D2b","D2c","D2d"],"marker":7}},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905],"a_label":"contributions","labels":["A4"],"marker":0},"value":0.1499999999999997,"value_label":"partial distance"},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816],"a_label":"contributions","labels":["A4","D4"],"marker":1},"value":0.20844389816010805,"value_label":"partial distance"},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172],"a_label":"contributions","labels":["A4","D4","D3a"],"marker":2},"value":0.8789269018320003,"value_label":"partial distance"},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172,0.7290636400838186,0.1899701691877942],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D2a"],"marker":4},"value":1.300594597880374,"value_label":"partial distance"},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172,0.7290636400838186,0.1899701691877942,0.5785015295724796],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D2a","D2b"],"marker":5},"value":1.5066677927161287,"value_label":"partial distance"},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172,0.7290636400838186,0.1899701691877942,0.5785015295724796,0.022520191970228913,0.22543931042586807],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D2a","D2b","D2c","D2d"],"marker":7},"value":1.5868230336128186,"value_label":"partial distance"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172,0.7290636400838186,0.1899701691877942,0.5785015295724796,0.022520191970228913,0.22543931042586807],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D2a","D2b","D2c","D2d"],"marker":0},"value":1.5868230336128186,"value_label":"final distance"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172,0.7290636400838186,0.1899701691877942,0.5785015295724796,0.022520191970228913,0.22543931042586807],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D2a","D2b","D2c","D2d"],"marker":2},"value":1.5868230336128186,"value_label":"final distance"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172,0.7290636400838186,0.1899701691877942,0.5785015295724796,0.022520191970228913,0.22543931042586807],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D2a","D2b","D2c","D2d"],"marker":5},"value":1.5868230336128186,"value_label":"final distance"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172,0.7290636400838186,0.1899701691877942,0.5785015295724796,0.022520191970228913,0.22543931042586807],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D2a","D2b","D2c","D2d"],"marker":7},"value":1.5868230336128186,"value_label":"final distance"}],"echotime_status":"Low-priority addition","echotime_api":""}
