{"id":"histogram_embedding_similarity","title":"Value histograms embedding similarity","family":"embedding","definition":"reference","intro_en":"Count observations in seven shared, fixed value intervals and divide by the sample count. The two probability vectors describe how often values occur. Shared edges make the coordinates comparable; all temporal ordering is intentionally removed. Cosine compares vector direction and is defined here for nonzero feature vectors.","intro_zh":"在七个共享、固定的数值区间中计数，再除以样本数。两个概率向量描述数值出现的频率。共享边界保证坐标可比较，同时有意舍弃全部时间顺序。 余弦比较向量方向，本例特征向量均非零。","steps_en":["Use identical bin edges for both inputs and normalize counts into bin probabilities.","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":["对两条序列使用相同分箱边界，将计数归一化为概率。","把计算得到的坐标按同一个固定顺序组成两个向量。","用两个向量的长度归一化坐标乘积之和，得到余弦相似度。","结合表示所舍弃的信息，在该表示空间中解释分数。"],"animation_steps_en":["Count values in shared bins and divide by the sample count.","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":["Separate automatic binning can make coordinate-wise comparison invalid; the edges must be shared.","Values within one bin are indistinguishable, and permuted sequences have identical histograms.","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":["分别自动分箱可能导致坐标不可比，因此必须共享边界。","同一区间内的数值无法区分，重排序列也具有相同直方图。","余弦忽略整个特征向量的正比例缩放；1-cosine 通常不满足度量公理，零向量还需明确处理规则。"],"sources":[{"label":"NumPy: histogram bins and normalization","url":"https://numpy.org/doc/stable/reference/generated/numpy.histogram.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":{"edges":[-1.5,-1.0,-0.5,0.0,0.5,1.0,1.5,2.0],"normalization":"probability mass, not density","comparison":"cosine"},"result":{"label":"similarity","value":0.778661114550567,"detail":"Computed from the explicitly defined illustrative encoder; no learned weights."},"frames":[{"phase":0,"caption":"Summarize the first 4 observations using the stated descriptor.","panel":{"kind":"bars","title":"Descriptor from first 4 samples","a":[0.0,0.0,0.0,0.25,0.75,0.0,0.0],"a_label":"x features","b":[0.0,0.0,0.25,0.25,0.25,0.25,0.0],"b_label":"y features","labels":["bin 1","bin 2","bin 3","bin 4","bin 5","bin 6","bin 7"]},"input_highlight":[0,1,2,3]},{"phase":0,"caption":"Summarize the first 6 observations using the stated descriptor.","panel":{"kind":"bars","title":"Descriptor from first 6 samples","a":[0.0,0.16666666666666666,0.0,0.3333333333333333,0.5,0.0,0.0],"a_label":"x features","b":[0.0,0.0,0.16666666666666666,0.3333333333333333,0.16666666666666666,0.3333333333333333,0.0],"b_label":"y features","labels":["bin 1","bin 2","bin 3","bin 4","bin 5","bin 6","bin 7"]},"input_highlight":[0,1,2,3,4,5]},{"phase":0,"caption":"Summarize the first 8 observations using the stated descriptor.","panel":{"kind":"bars","title":"Descriptor from first 8 samples","a":[0.0,0.25,0.125,0.25,0.375,0.0,0.0],"a_label":"x features","b":[0.0,0.0,0.375,0.25,0.125,0.25,0.0],"b_label":"y features","labels":["bin 1","bin 2","bin 3","bin 4","bin 5","bin 6","bin 7"]},"input_highlight":[0,1,2,3,4,5,6,7]},{"phase":0,"caption":"Summarize the first 10 observations using the stated descriptor.","panel":{"kind":"bars","title":"Descriptor from first 10 samples","a":[0.0,0.2,0.1,0.3,0.3,0.1,0.0],"a_label":"x features","b":[0.0,0.0,0.3,0.4,0.1,0.2,0.0],"b_label":"y features","labels":["bin 1","bin 2","bin 3","bin 4","bin 5","bin 6","bin 7"]},"input_highlight":[0,1,2,3,4,5,6,7,8,9]},{"phase":0,"caption":"Summarize the first 12 observations using the stated descriptor.","panel":{"kind":"bars","title":"Descriptor from first 12 samples","a":[0.0,0.16666666666666666,0.08333333333333333,0.25,0.3333333333333333,0.08333333333333333,0.08333333333333333],"a_label":"x features","b":[0.0,0.0,0.25,0.3333333333333333,0.16666666666666666,0.25,0.0],"b_label":"y features","labels":["bin 1","bin 2","bin 3","bin 4","bin 5","bin 6","bin 7"]},"input_highlight":[0,1,2,3,4,5,6,7,8,9,10,11]},{"phase":0,"caption":"Summarize the first 16 observations using the stated descriptor.","panel":{"kind":"bars","title":"Descriptor from first 16 samples","a":[0.0,0.125,0.125,0.3125,0.3125,0.0625,0.0625],"a_label":"x features","b":[0.0,0.0,0.3125,0.25,0.1875,0.25,0.0],"b_label":"y features","labels":["bin 1","bin 2","bin 3","bin 4","bin 5","bin 6","bin 7"]},"input_highlight":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]},{"phase":1,"caption":"Expose 1 of 7 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[0.0],"a_label":"x features","b":[0.0],"b_label":"y features","labels":["bin 1"],"marker":0}},{"phase":1,"caption":"Expose 2 of 7 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[0.0,0.125],"a_label":"x features","b":[0.0,0.0],"b_label":"y features","labels":["bin 1","bin 2"],"marker":1}},{"phase":1,"caption":"Expose 3 of 7 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[0.0,0.125,0.125],"a_label":"x features","b":[0.0,0.0,0.3125],"b_label":"y features","labels":["bin 1","bin 2","bin 3"],"marker":2}},{"phase":1,"caption":"Expose 4 of 7 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[0.0,0.125,0.125,0.3125],"a_label":"x features","b":[0.0,0.0,0.3125,0.25],"b_label":"y features","labels":["bin 1","bin 2","bin 3","bin 4"],"marker":3}},{"phase":1,"caption":"Expose 5 of 7 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[0.0,0.125,0.125,0.3125,0.3125],"a_label":"x features","b":[0.0,0.0,0.3125,0.25,0.1875],"b_label":"y features","labels":["bin 1","bin 2","bin 3","bin 4","bin 5"],"marker":4}},{"phase":1,"caption":"Expose 7 of 7 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[0.0,0.125,0.125,0.3125,0.3125,0.0625,0.0625],"a_label":"x features","b":[0.0,0.0,0.3125,0.25,0.1875,0.25,0.0],"b_label":"y features","labels":["bin 1","bin 2","bin 3","bin 4","bin 5","bin 6","bin 7"],"marker":6}},{"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.0],"a_label":"contributions","labels":["bin 1"],"marker":0},"value":0.0,"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.0,0.0],"a_label":"contributions","labels":["bin 1","bin 2"],"marker":1},"value":0.0,"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.0,0.0,0.15891043154093204],"a_label":"contributions","labels":["bin 1","bin 2","bin 3"],"marker":2},"value":0.15891043154093204,"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.0,0.0,0.15891043154093204,0.3178208630818641],"a_label":"contributions","labels":["bin 1","bin 2","bin 3","bin 4"],"marker":3},"value":0.4767312946227961,"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.0,0.0,0.15891043154093204,0.3178208630818641,0.23836564731139806],"a_label":"contributions","labels":["bin 1","bin 2","bin 3","bin 4","bin 5"],"marker":4},"value":0.7150969419341942,"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.0,0.0,0.15891043154093204,0.3178208630818641,0.23836564731139806,0.06356417261637282,0.0],"a_label":"contributions","labels":["bin 1","bin 2","bin 3","bin 4","bin 5","bin 6","bin 7"],"marker":6},"value":0.778661114550567,"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.0,0.0,0.15891043154093204,0.3178208630818641,0.23836564731139806,0.06356417261637282,0.0],"a_label":"contributions","labels":["bin 1","bin 2","bin 3","bin 4","bin 5","bin 6","bin 7"],"marker":0},"value":0.778661114550567,"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.0,0.0,0.15891043154093204,0.3178208630818641,0.23836564731139806,0.06356417261637282,0.0],"a_label":"contributions","labels":["bin 1","bin 2","bin 3","bin 4","bin 5","bin 6","bin 7"],"marker":2},"value":0.778661114550567,"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.0,0.0,0.15891043154093204,0.3178208630818641,0.23836564731139806,0.06356417261637282,0.0],"a_label":"contributions","labels":["bin 1","bin 2","bin 3","bin 4","bin 5","bin 6","bin 7"],"marker":4},"value":0.778661114550567,"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.0,0.0,0.15891043154093204,0.3178208630818641,0.23836564731139806,0.06356417261637282,0.0],"a_label":"contributions","labels":["bin 1","bin 2","bin 3","bin 4","bin 5","bin 6","bin 7"],"marker":6},"value":0.778661114550567,"value_label":"final similarity"}],"echotime_status":"Low-priority addition","echotime_api":""}
