code: def train_embedding_model(config_path: str = None, **kwargs):
      """Train a self-supervised model.
  
      Calls the same function as lightly-train. All arguments passed to
      lightly-train can also be passed to this function (see below for an
      example).
  
      Args:
          config_path:
              Path to config.yaml. If None, the default configs will be used.
          **kwargs:
              Overwrite default configs py passing keyword arguments.
  
      Returns:
          Path to checkpoint of the trained embedding model.
  
      Examples:
          >>> import lightly
          >>>
          >>> # train a model with default configs
          >>> checkpoint_path = lightly.train_embedding_model(
          >>>     input_dir='path/to/data')
          >>>
          >>> # train a model with separate config file
          >>> my_config_path = 'my/config/file.yaml'
          >>> checkpoint_path = lightly.train_embedding_model(
          >>>     input_dir='path/to/data', config_path=my_config_path)
          >>>
          >>> # train a model with default settings and overwrites: large batch
          >>> # sizes are benefitial for self-supervised training and more
          >>> # workers speed up the dataloading process.
          >>> my_loader = {
          >>>     batch_size: 100,
          >>>     num_workers: 8,
          >>> }
          >>> checkpoint_path = lightly.train_embedding_model(
          >>>     input_dir='path/to/data', loader=my_loader)
          >>> # the command above is equivalent to:
          >>> # lightly-train input_dir='path/to/data' loader.batch_size=100 loader.num_workers=8
      """
      config_path = _get_config_path(config_path)
      config_args = _load_config_file(config_path)
      config_args = _add_kwargs(config_args, kwargs)
  
      return _train_cli(config_args, is_cli_call=False)
  
file_path: lightly/lightly/core.py
imports: import os
  from typing import List, Tuple
  import numpy
  import yaml
  import lightly.cli
  from lightly.cli.embed_cli import _embed_cli
  from lightly.cli.lightly_cli import _lightly_cli
  from lightly.cli.train_cli import _train_cli
label_desc: Use image node_id 5 for calling a global function with example usage: train_embedding_model(config_path) and returns: _train_cli