class_docstr: FlashBaseFinetuning can be used to create a custom Flash Finetuning Callback.
class_docstr_tok: ["FlashBaseFinetuning","can","be","used","to","create","a","custom","Flash","Finetuning","Callback","."]
code: def finetune_function(
      self,
      pl_module: Union[Module, Iterable[Union[Module, Iterable]]],
      epoch: int,
      optimizer: Optimizer,
      opt_idx: int,
  ):
      if self.strategy == FinetuningStrategies.FREEZE_UNFREEZE:
          self._freeze_unfreeze_function(
              pl_module,
              epoch,
              optimizer,
              opt_idx,
              self.strategy_metadata,
          )
      elif self.strategy == FinetuningStrategies.UNFREEZE_MILESTONES:
          self._unfreeze_milestones_function(
              pl_module,
              epoch,
              optimizer,
              opt_idx,
              self.strategy_metadata,
          )
  
imports: import os
  from functools import partial
  from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
  from pytorch_lightning import LightningModule
  from pytorch_lightning.callbacks import BaseFinetuning
  from torch.nn import Module
  from torch.optim import Optimizer
  from flash.core.registry import FlashRegistry
label_desc: Use image node_id 7 for calling the FlashBaseFinetuning obj's underlying member method code with example usage: obj.finetune_function(pl_module, epoch, optimizer, opt_idx) without return types