class_docstr: Computes the similarity graph from a set of (dense) embeddings.
docstr: Generates edges based on considering all node pairs in `bucket`.
  
  Args:
    bucket: A `set` of all node IDs in the same LSH bucket.
    embeddings: A `dict`: node_id -> embedding.
  
  Yields:
    A tuple (source, target, weight) denoting a (directed) edge from 'source'
    to 'target' with the given edge 'weight'.
docstr_tok: ["Generates","edges","based","on","considering","all","node","pairs","in","`","bucket","`",".","Args",":","bucket",":","A","`","set","`","of","all","node","IDs","in","the","same","LSH","bucket",".","embeddings",":","A","`","dict","`",":","node_id","-",">","embedding",".","Yields",":","A","tuple","(","source",",","target",",","weight",")","denoting","a","(","directed",")","edge","from","'source'","to","'target","'","with","the","given","edge","'weight","'","."]
code: def _generate_edges_for_bucket(self, bucket, embeddings):
      """Generates edges based on considering all node pairs in `bucket`.
  
      Args:
        bucket: A `set` of all node IDs in the same LSH bucket.
        embeddings: A `dict`: node_id -> embedding.
  
      Yields:
        A tuple (source, target, weight) denoting a (directed) edge from 'source'
        to 'target' with the given edge 'weight'.
      """
      for src, tgt in itertools.combinations(bucket, 2):
          weight = np.dot(embeddings[src], embeddings[tgt])
          if weight >= self.config.similarity_threshold:
              if self.edge_set is None or self._is_new_edge(src, tgt):
                  yield (src, tgt, weight)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import itertools
  import time
  from absl import app
  from absl import flags
  from absl import logging
  import neural_structured_learning.configs
  import numpy
  import six
  import tensorflow
label_desc: Use image node_id 5 for calling the GraphBuilder obj's underlying member method code with example usage: obj._generate_edges_for_bucket(bucket, embeddings) without return types