Commit 3fcd660
Adds a new --lsh_bits flag to nsl.tools.build_graph().
If --lsh_bits > 0, all the input points are first bucketed into
at most 2^n buckets, where 'n' is the --lsh_bits value. Each of
the buckets is then considered independently, vastly reducing
the number of pairs of points that need to be compared for
similarity. Thus, the running time of the program can be reduced
dramatically when the number of input points is large, at the
potential expense of missing some graph edges.
This also introduces a new configuration class and a new top-level function:
nsl.configs.GraphBuilderConfig: graph building configuration object.
nsl.tools.build_graph_from_config(...): parameterized by GraphBuilderConfig.
PiperOrigin-RevId: 3183768051 parent 55cfd84 commit 3fcd660
File tree
6 files changed
+263
-80
lines changed- neural_structured_learning
- configs
- tools
6 files changed
+263
-80
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
| 21 | + | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
291 | 292 | | |
292 | 293 | | |
293 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
294 | 325 | | |
295 | 326 | | |
296 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
5 | 17 | | |
6 | 18 | | |
7 | | - | |
8 | | - | |
| 19 | + | |
| 20 | + | |
9 | 21 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | 22 | | |
14 | 23 | | |
15 | 24 | | |
| 25 | + | |
16 | 26 | | |
17 | 27 | | |
18 | 28 | | |
| |||
0 commit comments