class_docstr: This class implements a classifier with the PyTorch framework.
class_docstr_tok: ["This","class","implements","a","classifier","with","the","PyTorch","framework","."]
docstr: Create a copy of the classifier that can be refit from scratch. Will inherit same architecture, same type of
  optimizer and initialization as the original classifier, but without weights.
  
  :return: new estimator
code: def clone_for_refitting(self) -> "PyTorchClassifier":
      """
      Create a copy of the classifier that can be refit from scratch. Will inherit same architecture, same type of
      optimizer and initialization as the original classifier, but without weights.
  
      :return: new estimator
      """
      model = copy.deepcopy(self.model)
  
      if self._optimizer is None:  # pragma: no cover
          raise ValueError(
              "An optimizer is needed to train the model, but none is provided."
          )
  
      # create a new optimizer that binds to the cloned model's parameters and uses original optimizer's defaults
      new_optimizer = type(self._optimizer)(model.parameters(), **self._optimizer.defaults)  # type: ignore
  
      clone = type(self)(
          model,
          self._loss,
          self.input_shape,
          self.nb_classes,
          optimizer=new_optimizer,
      )
  
      # reset weights
      clone.reset()
      params = self.get_params()
      del params["model"]
      del params["optimizer"]
      clone.set_params(**params)
      return clone
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import copy
  import logging
  import os
  import time
  from typing import Any, Dict, List, Optional, Tuple, Union, TYPE_CHECKING
  from tqdm.auto import tqdm
  import numpy
  import six
  from art import config
  from art.estimators.classification.classifier import ClassGradientsMixin, ClassifierMixin
  from art.estimators.pytorch import PyTorchEstimator
  from art.utils import check_and_transform_label_format
label_desc: Use image node_id 15 for calling the PyTorchClassifier obj's underlying member method code with example usage: obj.clone_for_refitting() and returns: clone