class_docstr: Parameters
  ----------
  model : pytorch model
      The model to be pruned
  config_list : list
      Supported keys:
          - prune_iterations : The number of rounds for the iterative pruning.
          - sparsity : The final sparsity when the compression is done.
  optimizer : pytorch optimizer
      The optimizer for the model
  lr_scheduler : pytorch lr scheduler
      The lr scheduler for the model if used
  reset_weights : bool
      Whether reset weights and optimizer at the beginning of each round.
class_docstr_tok: ["Parameters","--","--","--","--","--","model",":","pytorch","model","The","model","to","be","pruned","config_list",":","list","Supported","keys",":","-","prune_iterations",":","The","number","of","rounds","for","the","iterative","pruning",".","-","sparsity",":","The","final","sparsity","when","the","compression","is","done",".","optimizer",":","pytorch","optimizer","The","optimizer","for","the","model","lr_scheduler",":","pytorch","lr","scheduler","The","lr","scheduler","for","the","model","if","used","reset_weights",":","bool","Whether","reset","weights","and","optimizer","at","the","beginning","of","each","round","."]
docstr: Parameters
  ----------
  model : torch.nn.Module
      Model to be pruned
  config_list : list
      Supported keys:
          - prune_iterations : The number of rounds for the iterative pruning.
          - sparsity : The final sparsity when the compression is done.
docstr_tok: ["Parameters","--","--","--","--","--","model",":","torch.nn.Module","Model","to","be","pruned","config_list",":","list","Supported","keys",":","-","prune_iterations",":","The","number","of","rounds","for","the","iterative","pruning",".","-","sparsity",":","The","final","sparsity","when","the","compression","is","done","."]
code: def validate_config(self, model, config_list):
      """
      Parameters
      ----------
      model : torch.nn.Module
          Model to be pruned
      config_list : list
          Supported keys:
              - prune_iterations : The number of rounds for the iterative pruning.
              - sparsity : The final sparsity when the compression is done.
      """
      schema = CompressorSchema(
          [
              {
                  "sparsity": And(float, lambda n: 0 < n < 1),
                  "prune_iterations": And(int, lambda n: n > 0),
                  Optional("op_types"): [str],
                  Optional("op_names"): [str],
              }
          ],
          model,
          logger,
      )
  
      schema.validate(config_list)
      assert (
          len(set([x["prune_iterations"] for x in config_list])) == 1
      ), "The values of prune_iterations must be equal in your config"
  
file_path: auptimizer/src/aup/compression/torch/pruning/lottery_ticket.py
imports: import copy
  import logging
  import torch
  from schema import And, Optional
  from ..utils.config_validation import CompressorSchema
  from ..compressor import Pruner
  from .finegrained_pruning import LevelPrunerMasker
label_desc: Use image node_id 2 for calling the LotteryTicketPruner obj's underlying member method code with example usage: obj.validate_config(model, config_list) without return types