Skip to content

a query about binary search local  #2

@MangoKiller

Description

@MangoKiller

Hello,
I am working through your implementation of the OPT attack,
If my understand is not wrong , the part of binary_search_local may waste some opportunities of query:

      if model.predict_label(x0+lbd*theta) == y0:
        lbd_lo = lbd
        lbd_hi = lbd*1.01
        nquery += 1
        while model.predict_label(x0+lbd_hi*theta) == y0:
            lbd_hi = lbd_hi*1.01
            nquery += 1
            if lbd_hi > 20:
                return float('inf'), nquery

In my opinion, if add lbd_lo = lbd_hi , you know, just like :

   if model.predict_label(x0+lbd*theta) == y0:
        lbd_lo = lbd
        lbd_hi = lbd*1.01
        nquery += 1
        while model.predict_label(x0+lbd_hi*theta) == y0:
            lbd_lo = lbd_hi 
            lbd_hi = lbd_hi*1.01
            nquery += 1
            if lbd_hi > 20:
                return float('inf'), nquery

Some opportunities of querying may be saved in the process of binary search.
I wonder if u could clarify this issue for me,
Thanks a miiiiiiiiiiiiillion!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions