class_docstr: Given a latent variable generating a given adversarial sample, either inferred by an inverse GAN or randomly
  generated, the InverseGAN optimizes that latent variable to project a sample as close as possible to the adversarial
  sample without the adversarial noise.
class_docstr_tok: ["Given","a","latent","variable","generating","a","given","adversarial","sample",",","either","inferred","by","an","inverse","GAN","or","randomly","generated",",","the","InverseGAN","optimizes","that","latent","variable","to","project","a","sample","as","close","as","possible","to","the","adversarial","sample","without","the","adversarial","noise","."]
code: def _check_params(self) -> None:
      if (
          self.inverse_gan is not None
          and self.gan.encoding_length
          != self.inverse_gan.encoding_length
      ):
          raise ValueError(
              "Both GAN and InverseGAN must use the same size encoding."
          )
  
file_path: adversarial-robustness-toolbox/art/defences/preprocessor/inverse_gan.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple, TYPE_CHECKING
  import numpy
  from scipy.optimize import minimize
  from art.defences.preprocessor.preprocessor import Preprocessor
label_desc: Use image node_id 5 for calling the InverseGAN obj's underlying member method code with example usage: obj._check_params() without return types