{"id":"wavelet_embedding_similarity","title":"Coarse Haar coefficients embedding similarity","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. Cosine compares vector direction and is defined here for nonzero feature vectors.","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.","Normalize by both vector lengths and sum coordinate products to obtain cosine similarity.","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.","Normalize vector products to obtain cosine similarity.","Read the score in this feature space, with its stated information loss."],"formula":"s(x,y) = dot(phi(x),phi(y)) / (norm(phi(x))*norm(phi(y)))","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.","Cosine ignores positive rescaling of the entire feature vector; 1-cosine is generally not a metric, and zero vectors require an explicit policy."],"caveats_zh":["这里使用截断变换；不同的高频细节可能产生完全相同的保留向量。","Haar 系数依赖对齐与边界处理。本例长度为二的幂，因此无需填充。","余弦忽略整个特征向量的正比例缩放；1-cosine 通常不满足度量公理，零向量还需明确处理规则。"],"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":"cosine"},"result":{"label":"similarity","value":0.8070436487799386,"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":"Sum normalized dot-product contributions from the displayed coordinates.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.3794051738096366],"a_label":"contributions","labels":["A4"],"marker":0},"value":0.3794051738096366,"value_label":"partial dot sum"},{"phase":2,"caption":"Sum normalized dot-product contributions from the displayed coordinates.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.3794051738096366,0.06049831414374912],"a_label":"contributions","labels":["A4","D4"],"marker":1},"value":0.43990348795338574,"value_label":"partial dot sum"},{"phase":2,"caption":"Sum normalized dot-product contributions from the displayed coordinates.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.3794051738096366,0.06049831414374912,0.060431872499268735],"a_label":"contributions","labels":["A4","D4","D3a"],"marker":2},"value":0.5003353604526545,"value_label":"partial dot sum"},{"phase":2,"caption":"Sum normalized dot-product contributions from the displayed coordinates.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.3794051738096366,0.06049831414374912,0.060431872499268735,0.060431872499268735,0.043827170967768635],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D2a"],"marker":4},"value":0.6045944039196919,"value_label":"partial dot sum"},{"phase":2,"caption":"Sum normalized dot-product contributions from the displayed coordinates.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.3794051738096366,0.06049831414374912,0.060431872499268735,0.060431872499268735,0.043827170967768635,0.03964858396377984],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D2a","D2b"],"marker":5},"value":0.6442429878834717,"value_label":"partial dot sum"},{"phase":2,"caption":"Sum normalized dot-product contributions from the displayed coordinates.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.3794051738096366,0.06049831414374912,0.060431872499268735,0.060431872499268735,0.043827170967768635,0.03964858396377984,0.07867053100714734,0.0841301298893196],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D2a","D2b","D2c","D2d"],"marker":7},"value":0.8070436487799386,"value_label":"partial dot sum"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.3794051738096366,0.06049831414374912,0.060431872499268735,0.060431872499268735,0.043827170967768635,0.03964858396377984,0.07867053100714734,0.0841301298893196],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D2a","D2b","D2c","D2d"],"marker":0},"value":0.8070436487799386,"value_label":"final similarity"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.3794051738096366,0.06049831414374912,0.060431872499268735,0.060431872499268735,0.043827170967768635,0.03964858396377984,0.07867053100714734,0.0841301298893196],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D2a","D2b","D2c","D2d"],"marker":2},"value":0.8070436487799386,"value_label":"final similarity"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.3794051738096366,0.06049831414374912,0.060431872499268735,0.060431872499268735,0.043827170967768635,0.03964858396377984,0.07867053100714734,0.0841301298893196],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D2a","D2b","D2c","D2d"],"marker":5},"value":0.8070436487799386,"value_label":"final similarity"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.3794051738096366,0.06049831414374912,0.060431872499268735,0.060431872499268735,0.043827170967768635,0.03964858396377984,0.07867053100714734,0.0841301298893196],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D2a","D2b","D2c","D2d"],"marker":7},"value":0.8070436487799386,"value_label":"final similarity"}],"echotime_status":"Low-priority addition","echotime_api":""}
