class_docstr: ```
  Abstract class used to tune and train Keras models. The fit method is
  an abstract method and must be implemented by subclasses.
  ```
class_docstr_tok: ["``","`","Abstract","class","used","to","tune","and","train","Keras","models",".","The","fit","method","is","an","abstract","method","and","must","be","implemented","by","subclasses",".","``","`"]
docstr: ```
  If freeze_range is None, makes all layers trainable=False except last Dense layer.
  If freeze_range is given, freezes the first <freeze_range> layers and
  unfrezes all remaining layers.
  NOTE:      Freeze method does not currently work with
             multi-GPU models.  If you are using the load_imagemodel method,
             please use the freeze_layers argument of load_imagemodel
             to freeze layers.
  Args:
      freeze_range(int): number of layers to freeze
  Returns:
      None
  ```
docstr_tok: ["``","`","If","freeze_range","is","None",",","makes","all","layers","trainable=False","except","last","Dense","layer",".","If","freeze_range","is","given",",","freezes","the","first","<","freeze_range",">","layers","and","unfrezes","all","remaining","layers",".","NOTE",":","Freeze","method","does","not","currently","work","with","multi-GPU","models",".","If","you","are","using","the","load_imagemodel","method",",","please","use","the","freeze_layers","argument","of","load_imagemodel","to","freeze","layers",".","Args",":","freeze_range","(","int",")",":","number","of","layers","to","freeze","Returns",":","None","``","`"]
code: def freeze(self, freeze_range=None):
      """
      ```
      If freeze_range is None, makes all layers trainable=False except last Dense layer.
      If freeze_range is given, freezes the first <freeze_range> layers and
      unfrezes all remaining layers.
      NOTE:      Freeze method does not currently work with
                 multi-GPU models.  If you are using the load_imagemodel method,
                 please use the freeze_layers argument of load_imagemodel
                 to freeze layers.
      Args:
          freeze_range(int): number of layers to freeze
      Returns:
          None
      ```
      """
  
      if freeze_range is None:
          # freeze everything except last Dense layer
          # first find last dense layer
          dense_id = None
          for i, layer in reversed(list(enumerate(self.model.layers))):
              if isinstance(layer, keras.layers.Dense):
                  dense_id = i
                  break
          if dense_id is None:
              raise Exception("cannot find Dense layer in this model")
          for i, layer in enumerate(self.model.layers):
              if i < dense_id:
                  layer.trainable = False
              else:
                  layer.trainable = True
      else:
          # freeze all layers up to and including layer_id
          if type(freeze_range) != type(1) or freeze_range < 1:
              raise ValueError("freeze_range must be integer > 0")
          for i, layer in enumerate(self.model.layers):
              if i < freeze_range:
                  layer.trainable = False
              else:
                  layer.trainable = True
      self._recompile()
      return
  
imports: from .None import utils
  from .graph.predictor import LinkPredictor, NodePredictor
  from .graph.preprocessor import LinkPreprocessor, NodePreprocessor
  from .imports import *
  from .lroptimize.lrfinder import *
  from .tabular.predictor import TabularPredictor
  from .tabular.preprocessor import TabularPreprocessor
  from .text.ner.predictor import NERPredictor
  from .text.ner.preprocessor import NERPreprocessor
  from .text.predictor import TextPredictor
  from .text.preprocessor import BERTPreprocessor, TextPreprocessor, TransformersPreprocessor
  from .vision.predictor import ImagePredictor
  from .vision.preprocessor import ImagePreprocessor
label_desc: Use image node_id 16 for calling the Learner obj's underlying member method code with example usage: obj.freeze(freeze_range) without return types