class_docstr: Manager for multiple ProjectionInterpreter instances.
  
  Presents a standard "Interpreter" interface so that client code can treat
  this as an ordinary stateless component.
  
  The config is used to uniquely identify the projection instance, and a new
  instance is created and fit if not found.
  
  Config must contain the following fields:
  - field_name: name of embedding field (in model output)
  - (optional) proj_kw: config for the underlying ProjectorModel
  
  We also recommend including the model name and dataset name in the key, but
  this is not explicitly enforced.
class_docstr_tok: ["Manager","for","multiple","ProjectionInterpreter","instances",".","Presents","a","standard","``","Interpreter","''","interface","so","that","client","code","can","treat","this","as","an","ordinary","stateless","component",".","The","config","is","used","to","uniquely","identify","the","projection","instance",",","and","a","new","instance","is","created","and","fit","if","not","found",".","Config","must","contain","the","following","fields",":","-","field_name",":","name","of","embedding","field","(","in","model","output",")","-","(","optional",")","proj_kw",":","config","for","the","underlying","ProjectorModel","We","also","recommend","including","the","model","name","and","dataset","name","in","the","key",",","but","this","is","not","explicitly","enforced","."]
code: def _train_instance(
      self,
      model: lit_model.Model,
      dataset: lit_dataset.Dataset,
      config: JsonDict,
      name: str,
  ) -> ProjectionInterpreter:
      # Ignore pytype warning about abstract methods, since this should always
      # be a subclass of ProjectorModel which has these implemented.
      projector = self._model_factory(
          **config.get("proj_kw", {})
      )  # pytype: disable=not-instantiable
      train_inputs = dataset.examples
  
      # If using input values, then treat inputs as outputs instead of running
      # the model.
      if config.get("use_input"):
          train_outputs = train_inputs
      else:
          train_outputs = list(model.predict(train_inputs))
      logging.info(
          "Creating new projection instance on %d points",
          len(train_inputs),
      )
      return ProjectionInterpreter(
          model,
          train_inputs,
          train_outputs,
          projector=projector,
          field_name=config["field_name"],
          name=name,
      )
  
imports: from collections.abc import Hashable, Sequence
  import threading
  from typing import Optional
  from absl import logging
  from lit_nlp.api import components
  from lit_nlp.api import dataset
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.lib import caching
label_desc: Use image node_id 2 for calling the ProjectionManager obj's underlying member method code with example usage: obj._train_instance(model, dataset, config, name) and returns: ProjectionInterpreter