class_docstr: Utility for training shadow models and generating shadow-datasets for membership inference attacks in scikit-learn,
  PyTorch and TensorFlow v2.
docstr: Initializes shadow models using the provided template.
  
  :param shadow_model_template: Untrained classifier model to be used as a template for shadow models. Should be
                                as similar as possible to the target model. Must implement clone_for_refitting
                                method.
  :param num_shadow_models: How many shadow models to train to generate the shadow dataset.
  :param disjoint_datasets: A boolean indicating whether the datasets used to train each shadow model should be
                            disjoint. Default is False.
  :param random_state: Seed for the numpy default random number generator.
docstr_tok: ["Initializes","shadow","models","using","the","provided","template",".",":","param","shadow_model_template",":","Untrained","classifier","model","to","be","used","as","a","template","for","shadow","models",".","Should","be","as","similar","as","possible","to","the","target","model",".","Must","implement","clone_for_refitting","method",".",":","param","num_shadow_models",":","How","many","shadow","models","to","train","to","generate","the","shadow","dataset",".",":","param","disjoint_datasets",":","A","boolean","indicating","whether","the","datasets","used","to","train","each","shadow","model","should","be","disjoint",".","Default","is","False",".",":","param","random_state",":","Seed","for","the","numpy","default","random","number","generator","."]
code: def __init__(
      self,
      shadow_model_template: "CLONABLE",
      num_shadow_models: int = 3,
      disjoint_datasets=False,
      random_state=None,
  ):
      """
      Initializes shadow models using the provided template.
  
      :param shadow_model_template: Untrained classifier model to be used as a template for shadow models. Should be
                                    as similar as possible to the target model. Must implement clone_for_refitting
                                    method.
      :param num_shadow_models: How many shadow models to train to generate the shadow dataset.
      :param disjoint_datasets: A boolean indicating whether the datasets used to train each shadow model should be
                                disjoint. Default is False.
      :param random_state: Seed for the numpy default random number generator.
      """
  
      self._shadow_models = [
          shadow_model_template.clone_for_refitting()
          for _ in range(num_shadow_models)
      ]
      self._shadow_models_train_sets: List[
          Optional[Tuple[np.ndarray, np.ndarray]]
      ] = [None] * num_shadow_models
      self._input_shape = shadow_model_template.input_shape
      self._rng = np.random.default_rng(seed=random_state)
      self._disjoint_datasets = disjoint_datasets
  
file_path: adversarial-robustness-toolbox/art/attacks/inference/membership_inference/shadow_models.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import math
  from functools import reduce
  from typing import Callable, Tuple, TYPE_CHECKING, List, Optional, Sequence
  import numpy
label_desc: Use image node_id 1 to create a new ShadowModels object  with example: obj = ShadowModels(shadow_model_template, num_shadow_models, disjoint_datasets, random_state)