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",".","``","`"]
code: def _recompile(self, wd=None):
      metrics = U.metrics_from_model(self.model)
      if (
          wd is not None
          and wd > 0
          and type(self.model.optimizer).__name__ != "AdamWeightDecay"
      ):
          warnings.warn(
              "recompiling model to use AdamWeightDecay as opimizer with weight decay of %s"
              % (wd)
          )
          optimizer = U.get_default_optimizer(wd=wd)
      elif wd is not None and wd > 0:
          optimizer = U.get_default_optimizer(wd=wd)
      elif wd is not None and wd == 0:
          optimizer = U.DEFAULT_OPT
      else:  # wd is None -> don't modify optimizer
          optimizer = self.model.optimizer
      self.model.compile(
          optimizer=optimizer, loss=self.model.loss, metrics=metrics
      )
  
      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 14 for calling the Learner obj's underlying member method code with example usage: obj._recompile(wd) without return types