docstr: Compiles keras model with losses
docstr_tok: ["Compiles","keras","model","with","losses"]
code: def _compile_model(self):
      """
      Compiles keras model with losses
      """
      losses = {}
      loss_weights = {}
  
      umap_loss_fn = umap_loss(
          self.batch_size,
          self.negative_sample_rate,
          self._a,
          self._b,
          self.edge_weight,
          self.parametric_embedding,
      )
      losses["umap"] = umap_loss_fn
      loss_weights["umap"] = 1.0
  
      if self.global_correlation_loss_weight > 0:
          losses["global_correlation"] = distance_loss_corr
          loss_weights[
              "global_correlation"
          ] = self.global_correlation_loss_weight
          if self.run_eagerly == False:
              # this is needed to avoid a 'NaN' error bug in tensorflow_probability (v0.12.2)
              warn(
                  "Setting tensorflow to run eagerly for global_correlation_loss."
              )
              self.run_eagerly = True
  
      if self.parametric_reconstruction:
          losses[
              "reconstruction"
          ] = self.parametric_reconstruction_loss_fcn
          loss_weights[
              "reconstruction"
          ] = self.parametric_reconstruction_loss_weight
  
      self.parametric_model.compile(
          optimizer=self.optimizer,
          loss=losses,
          loss_weights=loss_weights,
          run_eagerly=self.run_eagerly,
      )
  
imports: import numpy
  from umap import UMAP
  from warnings import warn, catch_warnings, filterwarnings
  from numba import TypingError
  import os
  from umap.spectral import spectral_layout
  from sklearn.utils import check_random_state
  import codecs, pickle
  from sklearn.neighbors import KDTree
  import sys
label_desc: Use image node_id 7 for calling the ParametricUMAP obj's underlying member method code with example usage: obj._compile_model() without return types