class_docstr: A global system that helps to manage the experiments.
class_docstr_tok: ["A","global","system","that","helps","to","manage","the","experiments","."]
docstr: Method for logging metrics during an experiment. In addition to using ``R``, one can also log to a specific recorder after getting it with `get_recorder` API.
  
  - If `active recorder` exists: it will log metrics through the active recorder.
  - If `active recorder` not exists: the system will create a default experiment as well as a new recorder, and log metrics under it.
  
  Here are some use cases:
  
  .. code-block:: Python
  
      # Case 1
      with R.start('test'):
          R.log_metrics(train_loss=0.33, step=1)
  
      # Case 2
      R.log_metrics(train_loss=0.33, step=1)
  
  Parameters
  ----------
  keyword argument:
      name1=value1, name2=value2, ...
docstr_tok: ["Method","for","logging","metrics","during","an","experiment",".","In","addition","to","using","``","R","``",",","one","can","also","log","to","a","specific","recorder","after","getting","it","with","`","get_recorder","`","API",".","-","If","`","active","recorder","`","exists",":","it","will","log","metrics","through","the","active","recorder",".","-","If","`","active","recorder","`","not","exists",":","the","system","will","create","a","default","experiment","as","well","as","a","new","recorder",",","and","log","metrics","under","it",".","Here","are","some","use","cases",":","..","code-block",":",":","Python","#","Case","1","with","R.start","(","'test","'",")",":","R.log_metrics","(","train_loss=0.33",",","step=1",")","#","Case","2","R.log_metrics","(","train_loss=0.33",",","step=1",")","Parameters","--","--","--","--","--","keyword","argument",":","name1=value1",",","name2=value2",",","..."]
code: def log_metrics(self, step=None, **kwargs):
      """
      Method for logging metrics during an experiment. In addition to using ``R``, one can also log to a specific recorder after getting it with `get_recorder` API.
  
      - If `active recorder` exists: it will log metrics through the active recorder.
      - If `active recorder` not exists: the system will create a default experiment as well as a new recorder, and log metrics under it.
  
      Here are some use cases:
  
      .. code-block:: Python
  
          # Case 1
          with R.start('test'):
              R.log_metrics(train_loss=0.33, step=1)
  
          # Case 2
          R.log_metrics(train_loss=0.33, step=1)
  
      Parameters
      ----------
      keyword argument:
          name1=value1, name2=value2, ...
      """
      self.get_exp(start=True).get_recorder(start=True).log_metrics(
          step, **kwargs
      )
  
imports: from contextlib import contextmanager
  from typing import Text, Optional, Any, Dict
  from .expm import ExpManager
  from .exp import Experiment
  from .recorder import Recorder
  from ..utils import Wrapper
  from ..utils.exceptions import RecorderInitializationError
  import sys
label_desc: Use image node_id 19 for calling the QlibRecorder obj's underlying member method code with example usage: obj.log_metrics(step) without return types