docstr: Checks if the sizes of sparse features have increased during fine-tuning.
  
  If there's any sparse feature size that has increased after changing the
  training data, we need to look for the corresponding `DenseForSparse` layer
  and adjust it. On the other hand, if none of them have increased, we don't
  need to change anything. This function helps us with making the decision.
  
  Note that the function assumes that none of the sparse feature sizes
  have decreased. In other words, it should get valid arguments in order
  to function well.
  
  Args:
      new_sparse_feature_sizes: sizes of current sparse features.
      old_sparse_feature_sizes: sizes of sparse features the model was
                                previously trained on.
  
  Returns:
      `True` if any of the sparse feature sizes has increased, `False` otherwise.
docstr_tok: ["Checks","if","the","sizes","of","sparse","features","have","increased","during","fine-tuning",".","If","there","'s","any","sparse","feature","size","that","has","increased","after","changing","the","training","data",",","we","need","to","look","for","the","corresponding","`","DenseForSparse","`","layer","and","adjust","it",".","On","the","other","hand",",","if","none","of","them","have","increased",",","we","don't","need","to","change","anything",".","This","function","helps","us","with","making","the","decision",".","Note","that","the","function","assumes","that","none","of","the","sparse","feature","sizes","have","decreased",".","In","other","words",",","it","should","get","valid","arguments","in","order","to","function","well",".","Args",":","new_sparse_feature_sizes",":","sizes","of","current","sparse","features",".","old_sparse_feature_sizes",":","sizes","of","sparse","features","the","model","was","previously","trained","on",".","Returns",":","`","True","`","if","any","of","the","sparse","feature","sizes","has","increased",",","`","False","`","otherwise","."]
code: def _sparse_feature_sizes_have_increased(
      new_sparse_feature_sizes: Dict[Text, Dict[Text, List[int]]],
      old_sparse_feature_sizes: Dict[Text, Dict[Text, List[int]]],
  ) -> bool:
      """Checks if the sizes of sparse features have increased during fine-tuning.
  
      If there's any sparse feature size that has increased after changing the
      training data, we need to look for the corresponding `DenseForSparse` layer
      and adjust it. On the other hand, if none of them have increased, we don't
      need to change anything. This function helps us with making the decision.
  
      Note that the function assumes that none of the sparse feature sizes
      have decreased. In other words, it should get valid arguments in order
      to function well.
  
      Args:
          new_sparse_feature_sizes: sizes of current sparse features.
          old_sparse_feature_sizes: sizes of sparse features the model was
                                    previously trained on.
  
      Returns:
          `True` if any of the sparse feature sizes has increased, `False` otherwise.
      """
      for (
          attribute,
          new_feature_sizes,
      ) in new_sparse_feature_sizes.items():
          old_feature_sizes = old_sparse_feature_sizes[attribute]
          for feature_type, new_sizes in new_feature_sizes.items():
              old_sizes = old_feature_sizes[feature_type]
              if sum(new_sizes) > sum(old_sizes):
                  return True
      return 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 4 for calling the TransformerRasaModel obj's underlying member method code with example usage: obj._sparse_feature_sizes_have_increased(new_sparse_feature_sizes, old_sparse_feature_sizes) and returns: False, True