class_docstr: Abstract Classification Model
class_docstr_tok: ["Abstract","Classification","Model"]
docstr: Configures the model for training.
  call :meth:`tf.keras.Model.predict` to compile model with custom loss, optimizer and metrics
  
  Examples:
  
      >>> model = BiLSTM_Model()
      # Build model with corpus
      >>> model.build_model(train_x, train_y)
      # Compile model with custom loss, optimizer and metrics
      >>> model.compile(loss='categorical_crossentropy', optimizer='rsm', metrics = ['accuracy'])
  
  Args:
      loss: name of objective function, objective function or ``tf.keras.losses.Loss`` instance.
      optimizer: name of optimizer or optimizer instance.
      metrics (object): List of metrics to be evaluated by the model during training and testing.
      **kwargs: additional params passed to :meth:`tf.keras.Model.predict``.
docstr_tok: ["Configures","the","model","for","training",".","call",":","meth",":","`","tf.keras.Model.predict","`","to","compile","model","with","custom","loss",",","optimizer","and","metrics","Examples",":",">",">",">","model","=","BiLSTM_Model","(",")","#","Build","model","with","corpus",">",">",">","model.build_model","(","train_x",",","train_y",")","#","Compile","model","with","custom","loss",",","optimizer","and","metrics",">",">",">","model.compile","(","loss='categorical_crossentropy","'",",","optimizer='rsm","'",",","metrics","=","[","'accuracy","'","]",")","Args",":","loss",":","name","of","objective","function",",","objective","function","or","``","tf.keras.losses.Loss","``","instance",".","optimizer",":","name","of","optimizer","or","optimizer","instance",".","metrics","(","object",")",":","List","of","metrics","to","be","evaluated","by","the","model","during","training","and","testing",".","*","*","kwargs",":","additional","params","passed","to",":","meth",":","`","tf.keras.Model.predict","``","."]
code: def compile_model(
      self,
      loss: Any = None,
      optimizer: Any = None,
      metrics: Any = None,
      **kwargs: Any,
  ) -> None:
      """
      Configures the model for training.
      call :meth:`tf.keras.Model.predict` to compile model with custom loss, optimizer and metrics
  
      Examples:
  
          >>> model = BiLSTM_Model()
          # Build model with corpus
          >>> model.build_model(train_x, train_y)
          # Compile model with custom loss, optimizer and metrics
          >>> model.compile(loss='categorical_crossentropy', optimizer='rsm', metrics = ['accuracy'])
  
      Args:
          loss: name of objective function, objective function or ``tf.keras.losses.Loss`` instance.
          optimizer: name of optimizer or optimizer instance.
          metrics (object): List of metrics to be evaluated by the model during training and testing.
          **kwargs: additional params passed to :meth:`tf.keras.Model.predict``.
      """
      if loss is None:
          if self.multi_label:
              loss = "binary_crossentropy"
          else:
              loss = "sparse_categorical_crossentropy"
      if optimizer is None:
          optimizer = "adam"
      if metrics is None:
          metrics = ["accuracy"]
  
      self.tf_model.compile(
          loss=loss, optimizer=optimizer, metrics=metrics, **kwargs
      )
  
imports: import random
  from abc import ABC
  import numpy
  from typing import List, Dict, Any, Union
  from sklearn import metrics
  from tensorflow import keras
  import kashgari
  from kashgari.embeddings import ABCEmbedding, BareEmbedding
  from kashgari.generators import BatchDataSet, CorpusGenerator
  from kashgari.layers import L
  from kashgari.logger import logger
  from kashgari.metrics.multi_label_classification import multi_label_classification_report
  from kashgari.processors import ABCProcessor
  from kashgari.processors import ClassificationProcessor
  from kashgari.processors import SequenceProcessor
  from kashgari.tasks.abs_task_model import ABCTaskModel
  from kashgari.types import TextSamplesVar, ClassificationLabelVar, MultiLabelClassificationLabelVar
label_desc: Use image node_id 7 for calling the ABCClassificationModel obj's underlying member method code with example usage: obj.compile_model(loss, optimizer, metrics) without return types