docstr: Compiles modified model and fits a sample data on it.
  
  Args:
      data_example: a data example that is stored with the ML component.
docstr_tok: ["Compiles","modified","model","and","fits","a","sample","data","on","it",".","Args",":","data_example",":","a","data","example","that","is","stored","with","the","ML","component","."]
code: def _compile_and_fit(
      self, data_example: Dict[Text, Dict[Text, List[FeatureArray]]]
  ) -> None:
      """Compiles modified model and fits a sample data on it.
  
      Args:
          data_example: a data example that is stored with the ML component.
      """
      self.compile(
          optimizer=tf.keras.optimizers.Adam(
              self.config[LEARNING_RATE]
          ),
          run_eagerly=self.config[RUN_EAGERLY],
      )
      label_key = (
          LABEL_KEY if self.config[INTENT_CLASSIFICATION] else None
      )
      label_sub_key = (
          LABEL_SUB_KEY if self.config[INTENT_CLASSIFICATION] else None
      )
  
      model_data = RasaModelData(
          label_key=label_key,
          label_sub_key=label_sub_key,
          data=data_example,
      )
      self._update_data_signatures(model_data)
      data_generator = RasaBatchDataGenerator(model_data, batch_size=1)
      self.fit(data_generator, verbose=False)
  
imports: import time
  import random
  import tensorflow
  import numpy
  import logging
  import os
  from collections import defaultdict
  from typing import List, Text, Dict, Tuple, Union, Optional, Any, TYPE_CHECKING
  from keras.utils import tf_utils
  from keras import Model
  from rasa.shared.constants import DIAGNOSTIC_DATA
  from rasa.utils.tensorflow.constants import LABEL, IDS, INTENT_CLASSIFICATION, SENTENCE, SEQUENCE_LENGTH, RANDOM_SEED, EMBEDDING_DIMENSION, REGULARIZATION_CONSTANT, SIMILARITY_TYPE, CONNECTION_DENSITY, NUM_NEG, LOSS_TYPE, MAX_POS_SIM, MAX_NEG_SIM, USE_MAX_NEG_SIM, NEGATIVE_MARGIN_SCALE, SCALE_LOSS, LEARNING_RATE, CONSTRAIN_SIMILARITIES, MODEL_CONFIDENCE, RUN_EAGERLY
  from rasa.utils.tensorflow.model_data import RasaModelData, FeatureSignature, FeatureArray
  import rasa.utils.train_utils
  from rasa.utils.tensorflow import layers
  from rasa.utils.tensorflow import rasa_layers
  from rasa.utils.tensorflow.data_generator import RasaDataGenerator, RasaBatchDataGenerator
  from rasa.shared.nlu.constants import TEXT
  from rasa.shared.exceptions import RasaException
  from rasa.utils.tensorflow.types import BatchData, MaybeNestedBatchData
label_desc: Use image node_id 6 for calling the TransformerRasaModel obj's underlying member method code with example usage: obj._compile_and_fit(data_example) without return types