6d9bd5a28272145a6216bdffec0d8226168f174d,cleverhans/future/torch/attacks/projected_gradient_descent.py,,projected_gradient_descent,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,10

Before Change


    targeted = False

  y_kwarg = "y_target" if targeted else "y"
  fgm_params = {
      y_kwarg: y,
      "clip_min": clip_min,
      "clip_max": clip_max
  }
  // TODO ignoring this for testing purposes
  
  if ord == 1:
      raise NotImplementedError("It"s not clear that FGM is a good inner loop"

After Change


  assert eps_iter <= eps, (eps_iter, eps)
  if y is not None and y_target is not None:
    raise ValueError("Must not set both y and y_target")
  if ord == 1:
    raise NotImplementedError("It"s not clear that FGM is a good inner loop"
                              " step for PGD when ord=1, because ord=1 FGM "
                              " changes only one pixel at a time. We need "
                              " to rigorously test a strong ord=1 PGD "
                              "before enabling this feature.")
  if ord not in [np.inf, 2]:
    raise ValueError("Norm order must be either np.inf or 2.")

  asserts = []

  // If a data range was specified, check that the input was in that range
  if clip_min is not None:
    assert_ge = torch.all(torch.ge(x, torch.tensor(clip_min, device=x.device, dtype=x.dtype)))
    asserts.append(assert_ge)

  if clip_max is not None:
    assert_le = torch.all(torch.le(x, torch.tensor(clip_max, device=x.device, dtype=x.dtype)))
    asserts.append(assert_le)

  // Initialize loop variables
  if rand_init:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: tensorflow/cleverhans
Commit Name: 6d9bd5a28272145a6216bdffec0d8226168f174d
Time: 2019-04-19
Author: papernot@google.com
File Name: cleverhans/future/torch/attacks/projected_gradient_descent.py
Class Name:
Method Name: projected_gradient_descent


Project Name: MolSSI/QCEngine
Commit Name: 644f878c0de6d4b235d749ee9a0f3ac0f67c7ce8
Time: 2019-06-04
Author: sjrl423@gmail.com
File Name: qcengine/programs/entos.py
Class Name: EntosHarness
Method Name: build_input


Project Name: arviz-devs/arviz
Commit Name: fff2b2fcaad05ad7fd020e3cf96a8edd49d62084
Time: 2021-01-13
Author: oriol.abril.pla@gmail.com
File Name: arviz/wrappers/base.py
Class Name: SamplingWrapper
Method Name: log_likelihood__i