class_docstr: Periodically generates and plots 2D embeddings of the data
  provided to ``data`` using the latest state of the ``Ivis`` model.
  The plots are designed to be viewed in Tensorboard, which will provide
  an image that shows the history of embeddings plots through training.
  By default, saves plots of the embeddings every epoch; increasing the
  ``epoch_interval`` will save the plots less frequently.
  
  :param list[float] data: Data to embed and plot with the latest Ivis
  :param list[int] labels: Labels with which to colour plotted
      embeddings. If `None` all points will have the same color.
  :param str log_dir: Folder to save resulting embeddings.
  :param str filename: Filename to save each file as. `{}` in string
      will be substituted with the epoch number.
  
  Example usage:
  ::
  
      from ivis.nn.callbacks import TensorBoardEmbeddingsImage
      from ivis import Ivis
      from tensorflow.keras.datasets import mnsit
  
      (X_train, Y_train), (X_test, Y_test)  = mnist.load_data()
  
      # Plot embeddings of test set every epoch colored by labels
      embeddings_callback = TensorBoardEmbeddingsImage(X_test, Y_test,
                                              log_dir='test-embeddings',
                                              filename='{}_test_embeddings.npy',
                                              epoch_interval=1)
  
      model = Ivis(callbacks=[embeddings_callback])
  
      # Train on training set
      model.fit(X_train)
class_docstr_tok: ["Periodically","generates","and","plots","2D","embeddings","of","the","data","provided","to","``","data","``","using","the","latest","state","of","the","``","Ivis","``","model",".","The","plots","are","designed","to","be","viewed","in","Tensorboard",",","which","will","provide","an","image","that","shows","the","history","of","embeddings","plots","through","training",".","By","default",",","saves","plots","of","the","embeddings","every","epoch",";","increasing","the","``","epoch_interval","``","will","save","the","plots","less","frequently",".",":","param","list","[","float","]","data",":","Data","to","embed","and","plot","with","the","latest","Ivis",":","param","list","[","int","]","labels",":","Labels","with","which","to","colour","plotted","embeddings",".","If","`","None","`","all","points","will","have","the","same","color",".",":","param","str","log_dir",":","Folder","to","save","resulting","embeddings",".",":","param","str","filename",":","Filename","to","save","each","file","as",".","`","{","}","`","in","string","will","be","substituted","with","the","epoch","number",".","Example","usage",":",":",":","from","ivis.nn.callbacks","import","TensorBoardEmbeddingsImage","from","ivis","import","Ivis","from","tensorflow.keras.datasets","import","mnsit","(","X_train",",","Y_train",")",",","(","X_test",",","Y_test",")","=","mnist.load_data","(",")","#","Plot","embeddings","of","test","set","every","epoch","colored","by","labels","embeddings_callback","=","TensorBoardEmbeddingsImage","(","X_test",",","Y_test",",","log_dir='test-embeddings","'",",","filename=","'","{","}","_test_embeddings.npy","'",",","epoch_interval=1",")","model","=","Ivis","(","callbacks=","[","embeddings_callback","]",")","#","Train","on","training","set","model.fit","(","X_train",")"]
code: def on_epoch_end(self, epoch, logs=None):
      self.epochs_since_last_save += 1
      if self.epochs_since_last_save >= self.epoch_interval:
          self.embeddings = self.model.layers[3].predict(self.data)
          image = self.plot_embeddings(self.embeddings)
          with self.file_writer.as_default():
              tf.summary.image("Embeddings", image, step=epoch)
  
imports: import io
  import os
  import numpy
  import tensorflow
  from tensorflow.keras.callbacks import Callback
  from sklearn.preprocessing import MinMaxScaler
label_desc: Use image node_id 2 for calling the TensorBoardEmbeddingsImage obj's underlying member method code with example usage: obj.on_epoch_end(epoch, logs) without return types