code: def finetune_function(
      self,
      pl_module: LightningModule,
      epoch: int,
      optimizer: Optimizer,
      opt_idx: int,
  ):
      if epoch == self.milestones[0]:
          # unfreeze 5 last layers
          self.unfreeze_and_add_param_group(
              modules=pl_module.feature_extractor[-5:],  # type: ignore
              optimizer=optimizer,
              train_bn=self.train_bn,
          )
  
      elif epoch == self.milestones[1]:
          # unfreeze remaining layers
          self.unfreeze_and_add_param_group(
              modules=pl_module.feature_extractor[:-5],  # type: ignore
              optimizer=optimizer,
              train_bn=self.train_bn,
          )
  
imports: import logging
  from pathlib import Path
  from typing import Union
  import numpy
  import torch
  import torch.nn.functional
  from torch import nn, optim
  from torch.optim.lr_scheduler import MultiStepLR
  from torch.optim.optimizer import Optimizer
  from torch.utils.data import DataLoader, Subset
  from torchmetrics.classification import MulticlassAccuracy
  from torchvision import models, transforms
  from torchvision.datasets import ImageFolder
  from torchvision.datasets.utils import download_and_extract_archive
  from pytorch_lightning import LightningDataModule, LightningModule
  from pytorch_lightning.callbacks.finetuning import BaseFinetuning
  from pytorch_lightning.utilities.rank_zero import rank_zero_info
label_desc: Use image node_id 3 for calling the MilestonesFinetuning obj's underlying member method code with example usage: obj.finetune_function(pl_module, epoch, optimizer, opt_idx) without return types