大模型时代下向量数据库的设计与应用音频 音频向量Embeddings ## 向量数据库 - 两个向量可以计算它们的距离(欧式,余弦/内积,曼哈顿等),距离越近,表示这两个物体越相似 • 向量搜索的基本问题:K-Nearest Neighbor • 在已有的N个向量中找出与给定向量距离最近的K个向量 ^{2}}} $$ ### 2. KNN算法 01 距离度量 02 KNN算法 03 KD树划分 04 KD树搜索 ### 2. KNN算法 k近邻法(k-Nearest Neighbor, kNN)是一种比较成熟也是最简单的机器学习算法,可以用于基本的分类与回归方法。 算法的主要思路: 如果一个样本在特征空间中与k个实例最为相似(即特征空间中最邻近),那么这k个 对于分类问题:对新的样本,根据其k个最近邻的训练样本的类别,通过多数表决等方式进行预测。 对于回归问题:对新的样本,根据其k个最近邻的训练样本标签值的均值作为预测值。 ### 2. KNN算法 k近邻法(k-Nearest Neighbor,kNN)是一种比较成熟也是最简单的机器学习算法,可以用于基本的分类与回归方法。 k近邻法的三要素: • k值选择。 • 距离度量。 • 决策规则。 ### 2. KNN算法 统计学习方法[M]. 北京: 清华大学出版社, 2019. [3] 周志华. 机器学习[M]. 北京: 清华大学出版社, 2016. [4] Cover T M, Hart P E. Nearest neighbor pattern classification[J]. IEEE Trans.inf.theory, 1953, 13(1):21-27. [5] Hastie T., Tibshirani0 码力 | 26 页 | 1.60 MB | 2 年前3
Greenplum机器学习⼯具集和案例(Apriori) Clustering (k-Means) Topic Modelling (Latent Dirichlet Allocation) Nearest Neighbors • k-Nearest Neighbors ## Graph All Pairs Shortest Path (APSP) Breadth-First Search Average Path Length0 码力 | 58 页 | 1.97 MB | 2 年前3
2020美团技术年货 算法篇Knowledge Management, 2017, pp. 1419 – 1428. [9] W. Dong, C. Moses, and K. Li, “Efficient k-nearest neighbor graph construction for generic similarity measures,” in Proceedings of the 20th international0 码力 | 317 页 | 16.57 MB | 2 年前3
generic graph libraries(all vertices $v$ s.t. $(u,v) \in E$, i.e., s.t. edge $(u,v)$ is in the graph) • Then for each neighbor, find its neighbors (and so on)  12 color[u] ← BLACK Enumerate vertices "Vertex properties" enumerate neighbor vertices enumerate neighbor vertices v ∈ Adj(G)[u] → (u, v) ∈ E(G) cf: CLRS ## Minimalist Approach: Index Adjacency empty()) { auto u = Q.front(); Q.pop(); for (auto&& v : graph[u]) { // neighbor vertex if (color[v] == WHITE) { color[v] = GREY; Q.push(v);0 码力 | 76 页 | 6.59 MB | 1 年前3
Game Development for Human Beingssolving this problem is to start from the original position and to expand the search range by checking neighbor tiles, while avoiding obstacles, as shown in the example below. However, we must choose an efficient We will do that by creating a given number of rooms by traveling a grid, and then connecting the neighbor rooms.  Zenva “created rooms” list 4 Add a random number of neighbor coordinates of the current room to “rooms to create” 3 After all rooms are created, connect all neighbor rooms Notice that, for this algorithm to work0 码力 | 472 页 | 8.46 MB | 1 年前3
Cache-Friendly Design in Robot Path Planningextract_min() if prev[u] is not UNDEFINED: continue prev[u] ← p if u is target: break for each neighbor v of u with prev[v] is UNDEFINED: dist_v ← dist_u + Graph.Edge(u, v) Q.add_with_priority((u extract_min() if prev[u] is not UNDEFINED: continue prev[u] ← p if u is target: break for each neighbor v of u with prev[v] is UNDEFINED: dist_v ← dist_u + Graph.Edge(u, v) Q.add_with_priority((u extract_min() if prev[u] is not UNDEFINED: continue prev[u] ← p if u is target: break for each neighbor v of u with prev[v] is UNDEFINED: dist_v ← dist_u + Graph.Edge(u, v) Q.add_with_priority((u0 码力 | 216 页 | 10.68 MB | 1 年前3
Cilium v1.11 Documentationuplink 0"; local {{ NODE_IP }} as {{ NODE_ASN }}; neighbor {{ NEIGHBOR_0_IP }} as {{ NEIGHBOR_0_ASN }}; password {{ NEIGHBOR_PWD }}; ipv4 { import filter {reject;}; uplink 1"; local {{ NODE_IP }} as {{ NODE_ASN }}; neighbor {{ NEIGHBOR_1_IP }} as {{ NEIGHBOR_1_ASN }}; password {{ NEIGHBOR_PWD }}; ipv4 { import filter {reject;}; sed -i 's/{{ NEIGHBOR_0_IP }}/neighbor 0 ip>/g' /etc/bird.conf sed -i 's/{{ NEIGHBOR_1_IP }}/ neighbor 1 ip>/g' /etc/bird.conf sed -i 's/{{ NEIGHBOR_0_ASN }}/ neighbor 0 asn>/g' 0 码力 | 1373 页 | 19.37 MB | 1 年前3
Cilium v1.7 Documentationuplink 0"; local {{ NODE_IP }} as {{ NODE_ASN }}; neighbor {{ NEIGHBOR_0_IP }} as {{ NEIGHBOR_0_ASN }}; password {{ NEIGHBOR_PWD }}; ipv4 { import filter {reject;}; uplink 1"; local {{ NODE_IP }} as {{ NODE_ASN }}; neighbor {{ NEIGHBOR_1_IP }} as {{ NEIGHBOR_1_ASN }}; password {{ NEIGHBOR_PWD }}; ipv4 { import filter {reject;}; sed -i 's/{{ NEIGHBOR_0_IP }}/neighbor 0 ip>/g' /etc/bird.conf sed -i 's/{{ NEIGHBOR_1_IP }}/ neighbor 1 ip>/g' /etc/bird.conf sed -i 's/{{ NEIGHBOR_0_ASN }}/ neighbor 0 asn>/g' 0 码力 | 885 页 | 12.41 MB | 1 年前3
Cilium v1.8 Documentationuplink 0"; local {{ NODE_IP }} as {{ NODE_ASN }}; neighbor {{ NEIGHBOR_0_IP }} as {{ NEIGHBOR_0_ASN }}; password {{ NEIGHBOR_PWD }}; ipv4 { import filter {reject;}; uplink 1"; local {{ NODE_IP }} as {{ NODE_ASN }}; neighbor {{ NEIGHBOR_1_IP }} as {{ NEIGHBOR_1_ASN }}; password {{ NEIGHBOR_PWD }}; ipv4 { import filter {reject;}; sed -i 's/{{ NEIGHBOR_0_IP }}/neighbor 0 ip>/g' /etc/bird.conf sed -i 's/{{ NEIGHBOR_1_IP }}/ neighbor 1 ip>/g' /etc/bird.conf sed -i 's/{{ NEIGHBOR_0_ASN }}/ neighbor 0 asn>/g' 0 码力 | 1124 页 | 21.33 MB | 1 年前3
共 358 条
- 1
- 2
- 3
- 4
- 5
- 6
- 36













