class_docstr: Periodically generates and plots 2D embeddings of the data
  provided to ``data`` using the latest state of the ``Ivis`` model.
  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 model
  :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 EmbeddingsImage
      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 = EmbeddingsImage(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",".","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","model",":","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","EmbeddingsImage","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","=","EmbeddingsImage","(","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.epochs_since_last_save = 0
          self.embeddings = self.model.layers[3].predict(self.data)
          filename = self.filename.format(epoch + 1)
          self.plot_embeddings(filename)
  
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 EmbeddingsImage obj's underlying member method code with example usage: obj.on_epoch_end(epoch, logs) without return types