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 freeze_before_training(
      self, pl_module: Union[Module, Iterable[Union[Module, Iterable]]]
  ) -> None:
      if self.strategy != FinetuningStrategies.NO_FREEZE:
          modules = self._get_modules_to_freeze(pl_module=pl_module)
          if modules is not None:
              if isinstance(modules, Module):
                  modules = [modules]
              self.freeze(modules=modules, train_bn=self.train_bn)
  
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 3 for calling the FlashBaseFinetuning obj's underlying member method code with example usage: obj.freeze_before_training(pl_module) without return types