def run(self, input_dir, output_dir, epsilon):
    """Runs attack inside Docker.

    Args:
      input_dir: directory with input (dataset).
      output_dir: directory where output (adversarial images) should be written.
      epsilon: maximum allowed size of adversarial perturbation,
        should be in range [0, 255].

    Returns:
      how long it took to run submission in seconds
    """
    logging.info('Running attack %s', self.submission_id)
    tmp_run_dir = self.temp_copy_extracted_submission()
    cmd = ['--network=none',
           '-m=24g',
           '--cpus=3.75',
           '-v', '{0}:/input_images:ro'.format(input_dir),
           '-v', '{0}:/output_images'.format(output_dir),
           '-v', '{0}:/code'.format(tmp_run_dir),
           '-w', '/code',
           self.container_name,
           './' + self.entry_point,
           '/input_images',
           '/output_images',
           str(epsilon)]
    elapsed_time_sec = self.run_with_time_limit(cmd)
    sudo_remove_dirtree(tmp_run_dir)
    return elapsed_time_sec
def run ( self , input_dir , output_dir , epsilon ) : logging . info ( 'Running attack %s' , self . submission_id ) tmp_run_dir = self . temp_copy_extracted_submission ( ) cmd = [ '--network=none' , '-m=24g' , '--cpus=3.75' , '-v' , '{0}:/input_images:ro' . format ( input_dir ) , '-v' , '{0}:/output_images' . format ( output_dir ) , '-v' , '{0}:/code' . format ( tmp_run_dir ) , '-w' , '/code' , self . container_name , './' + self . entry_point , '/input_images' , '/output_images' , str ( epsilon ) ] elapsed_time_sec = self . run_with_time_limit ( cmd ) sudo_remove_dirtree ( tmp_run_dir ) return elapsed_time_sec
Runs attack inside Docker.

    Args:
      input_dir: directory with input (dataset).
      output_dir: directory where output (adversarial images) should be written.
      epsilon: maximum allowed size of adversarial perturbation,
        should be in range [0, 255].

    Returns:
      how long it took to run submission in seconds