nsl.configs.GraphBuilderConfig

Encapsulates configuration parameters for building a graph.

Used in the notebooks

Used in the tutorials

For more information, see nsl.tools.build_graph_from_config.

id_feature_name The name of the feature in the input tf.train.Example objects representing the ID of examples. Defaults to 'id'.
embedding_feature_name The name of the feature in the input tf.train.Example objects representing the embedding of examples. Defaults to 'embedding'.
similarity_threshold Threshold used to determine which edges to retain in the resulting graph. Defaults to 0.8.
lsh_splits On each LSH bucketing round, the space containing the input instances will be randomly split/partitioned this many times for better graph builder performance. See the nsl.tools.build_graph_from_config documentation for details. Defaults to 0, in which case all pairs of inputs will be compared, probably resulting in slow running times on larger input sets.
lsh_rounds The number of rounds of LSH bucketing to perform when lsh_splits > 0. This is also the number of LSH buckets each point will be hashed into. Defaults to 1.
random_seed Value used to seed the random number generator used to perform randomized LSH bucketing of the inputs when lsh_splits > 0. By default, the generator will be initialized randomly, but setting this to any integer will initialize it deterministically. Defaults to None.

Methods

__eq__

Method generated by attrs for class GraphBuilderConfig.

__ge__

Method generated by attrs for class GraphBuilderConfig.

__gt__

Method generated by attrs for class GraphBuilderConfig.

__le__

Method generated by attrs for class GraphBuilderConfig.

__lt__

Method generated by attrs for class GraphBuilderConfig.

__ne__

Method generated by attrs for class GraphBuilderConfig.