towhee.models.collaborative_experts.collaborative_experts.sharded_single_view_inner_product(embds, subspaces, text_weights=None, l2renorm=True)[source]

Compute a similarity matrix from sharded vectors.

  • embds (dict) – The set of sub-embeddings that, when concatenated, form the whole. The ith shard has shape B x K x F_i (i.e. they can differ in the last dimension), or shape B x F_i

  • l2norm (bool) – Whether to l2 normalize the full embedding.


Similarity matrix of size BK x BK.

Return type: