class_docstr: Class performing adversarial training following Oracle Aligned Adversarial Training (OAAT) protocol.
  
  | Paper link: https://link.springer.com/chapter/10.1007/978-3-031-20065-6_18
class_docstr_tok: ["Class","performing","adversarial","training","following","Oracle","Aligned","Adversarial","Training","(","OAAT",")","protocol",".","|","Paper","link",":","https",":","\/\/link.springer.com\/chapter\/10.1007\/978-3-031-20065-6_18"]
docstr: adjust learning rate of the optimizer.
  
  :param optimizer: optimizer of the classifier.
  :param epoch: current training epoch.
  :param nb_epochs: total training epoch.
  :param lr_schedule: string denoting learning rate scheduler for optimizer
  :return: calculated learning rate
docstr_tok: ["adjust","learning","rate","of","the","optimizer",".",":","param","optimizer",":","optimizer","of","the","classifier",".",":","param","epoch",":","current","training","epoch",".",":","param","nb_epochs",":","total","training","epoch",".",":","param","lr_schedule",":","string","denoting","learning","rate","scheduler","for","optimizer",":","return",":","calculated","learning","rate"]
code: def update_learning_rate(
      self,
      optimizer: "torch.optim.optimizer.Optimizer",
      epoch: int,
      nb_epochs: int,
      lr_schedule: str = "step",
  ) -> None:
      """
      adjust learning rate of the optimizer.
  
      :param optimizer: optimizer of the classifier.
      :param epoch: current training epoch.
      :param nb_epochs: total training epoch.
      :param lr_schedule: string denoting learning rate scheduler for optimizer
      :return: calculated learning rate
      """
      if lr_schedule.lower() == "cosine":
          if self._train_params["oaat_warmup"] == 1:
              l_r = (
                  self._train_params["lr"]
                  * 0.5
                  * (
                      1
                      + np.cos((epoch - 10) / (nb_epochs - 10) * np.pi)
                  )
              )
          else:
              l_r = (
                  self._train_params["lr"]
                  * 0.5
                  * (1 + np.cos(epoch / nb_epochs * np.pi))
              )
  
          for param_group in optimizer.param_groups:
              param_group["lr"] = l_r
  
      elif lr_schedule.lower() == "linear":
          l_r = (epoch + 1) * (self._train_params["lr"] / 10)
  
          for param_group in optimizer.param_groups:
              param_group["lr"] = l_r
  
      elif lr_schedule.lower() == "step":
          if epoch >= 75 * nb_epochs / 110:
              l_r = self._train_params["lr"] * 0.1
          if epoch >= 90 * nb_epochs / 110:
              l_r = self._train_params["lr"] * 0.01
          if epoch >= 100 * nb_epochs / 110:
              l_r = self._train_params["lr"] * 0.001
  
          for param_group in optimizer.param_groups:
              param_group["lr"] = l_r
      else:
          raise ValueError(f"lr_schedule {lr_schedule} not supported")
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  from collections import OrderedDict
  import logging
  import os
  import time
  from typing import Optional, Tuple, TYPE_CHECKING, List, Dict, Union
  import six
  import numpy
  from tqdm.auto import trange
  from art import config
  from art.defences.trainer.adversarial_trainer_oaat import AdversarialTrainerOAAT
  from art.estimators.classification.pytorch import PyTorchClassifier
  from art.data_generators import DataGenerator
  from art.attacks.attack import EvasionAttack
  from art.utils import check_and_transform_label_format, random_sphere
  from art.config import ART_NUMPY_DTYPE
label_desc: Use image node_id 11 for calling the AdversarialTrainerOAATPyTorch obj's underlying member method code with example usage: obj.update_learning_rate(optimizer, epoch, nb_epochs, lr_schedule) without return types