Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 10: Sketching S3: Nearest Neighbor Search

Similar presentations


Presentation on theme: "Lecture 10: Sketching S3: Nearest Neighbor Search"β€” Presentation transcript:

1 Lecture 10: Sketching S3: Nearest Neighbor Search
Left to the title, a presenter can insert his/her own image pertinent to the presentation.

2 Plan PS2 due yesterday, 7pm Sketching Nearest Neighbor Search Scriber?

3 Sketching 𝑆: β„œ 𝑑 β†’ short bit-strings β„“ 2 , β„“ 1 norm: 𝑂( πœ– βˆ’2 ) words
given 𝑆(π‘₯) and 𝑆(𝑦), should be able to estimate some function of π‘₯ and 𝑦 With 90% success probability (𝛿=0.1) β„“ 2 , β„“ 1 norm: 𝑂( πœ– βˆ’2 ) words Decision version: given π‘Ÿ in advance… Lemma: β„“ 2 , β„“ 1 norm: 𝑂( πœ– βˆ’2 ) bits 𝑦 π‘₯ 𝑆 𝑆 010110 010101 Distinguish between ||π‘₯βˆ’π‘¦||β‰€π‘Ÿ ||π‘₯βˆ’π‘¦||> 1+πœ– π‘Ÿ Estimate ||π‘₯βˆ’π‘¦| | 2

4 Sketching: decision version
Consider Hamming space: π‘₯,π‘¦βˆˆ 0,1 𝑑 Lemma: for any π‘Ÿ>0, can achieve 𝑂(1/ πœ– 2 ) -bit sketch. [on blackboard]

5 Conclusion Dimension reduction: In β„“ 1 : no dimension reduction
[Johnson-Lindenstrauss’84]: a random linear projection into π‘˜ dimensions preserves ||π‘₯βˆ’π‘¦| | 2 , up to 1+πœ– approximation with probability β‰₯1βˆ’ 𝑒 βˆ’Ξ© πœ– 2 π‘˜ Random linear projection: Can be 𝐺π‘₯ where 𝐺 is Gaussian, or Β±1 entry-wise Hence: preserves distance between 𝑛 points as long as π‘˜=Θ 1 πœ– 2 log 𝑛 Can do faster than 𝑂(π‘‘π‘˜) time Using Fast Fourier Transform In β„“ 1 : no dimension reduction But can do sketching Using 𝑝-stable distributions (Cauchy for 𝑝=1) Sketching: decision version, constant 𝛿=0.1: For β„“ 1 , β„“ 2 , can do with 𝑂 1 πœ– 2 bits!

6 Section 3: Nearest Neighbor Search

7 Approximate NNS 𝑐-approximate π‘Ÿ-near neighbor: given a query point π‘ž
assuming there is a point 𝑝 βˆ— within distance π‘Ÿ, report a point 𝑝 β€² ∈𝐷 s.t. π‘β€²βˆ’π‘ž π‘β€²βˆ’π‘ž β‰€π‘π‘Ÿ π‘Ÿ 𝑝 βˆ— π‘π‘Ÿ π‘ž 𝑝 β€²

8 NNS: approach 1 Boosted sketch:
Let 𝑆 = sketch for the decision version (90% success probability) new sketch π‘Š : keep π‘˜=𝑂( log 𝑛 ) copies of 𝑆 estimator is the majority answer of the π‘˜ estimators Sketch size: 𝑂( πœ– βˆ’2 log 𝑛 ) bits Success probability: 1βˆ’ 𝑛 βˆ’2 (Chernoff) Preprocess: compute sketches π‘Š(𝑝) for all the points π‘βˆˆπ· Query: compute sketch π‘Š(π‘ž), and compute distance to all points using sketch Time: improved from 𝑂(𝑛𝑑) to 𝑂(𝑛 πœ– βˆ’2 log 𝑛 )

9 NNS: approach 2 Query time below 𝑛 ?
Theorem [KOR98]: 𝑂(𝑑 πœ– βˆ’2 log 𝑛) query time and 𝑛 𝑂 1/ πœ– 2 space for 1+πœ– approximation. Proof: Note that π‘Š(π‘ž) has 𝑀=𝑂 πœ– βˆ’2 log 𝑛 bits Only 2 𝑀 possible sketches! Store an answer for each of 2 𝑀 = 𝑛 𝑂 πœ– βˆ’2 possible inputs In general: if a distance has constant-size sketch, admits a poly-space NNS data structure! Space closer to linear? approach 3 will require more specialized sketches…


Download ppt "Lecture 10: Sketching S3: Nearest Neighbor Search"

Similar presentations


Ads by Google