class_docstr: Combination of a Storage containing previous experiments and an optional similarity metric.
  
  The Knowledge base is used to fetch previous experiments and their trials, which are then used
  to initialize (a.k.a. "warm-start" the hyper-parameter optimization algorithm.
  
  By default, the HPO algorithms of Orion are unable to reuse trials if they are not compatible
  with the space of the current (a.k.a. "target") experiment. Therefore, when warm-starting, a
  `MultiTaskWrapper` is added, which enables a limited form of warm-starting for all algorithms,
  by only considering the trials which are compatible with the target experiment, and training
  the algorithm in a multi-task fashion.
  
  When passed, the similarity function will be used to order the experiments such that the most
  related experiments are given first.
class_docstr_tok: ["Combination","of","a","Storage","containing","previous","experiments","and","an","optional","similarity","metric",".","The","Knowledge","base","is","used","to","fetch","previous","experiments","and","their","trials",",","which","are","then","used","to","initialize","(","a.k.a",".","``","warm-start","''","the","hyper-parameter","optimization","algorithm",".","By","default",",","the","HPO","algorithms","of","Orion","are","unable","to","reuse","trials","if","they","are","not","compatible","with","the","space","of","the","current","(","a.k.a",".","``","target","''",")","experiment",".","Therefore",",","when","warm-starting",",","a","`","MultiTaskWrapper","`","is","added",",","which","enables","a","limited","form","of","warm-starting","for","all","algorithms",",","by","only","considering","the","trials","which","are","compatible","with","the","target","experiment",",","and","training","the","algorithm","in","a","multi-task","fashion",".","When","passed",",","the","similarity","function","will","be","used","to","order","the","experiments","such","that","the","most","related","experiments","are","given","first","."]
docstr: Returns the configuration of the knowledge base.
  
  By default, returns a dictionary containing the attributes of `self` which are also
  constructor arguments.
docstr_tok: ["Returns","the","configuration","of","the","knowledge","base",".","By","default",",","returns","a","dictionary","containing","the","attributes","of","`","self","`","which","are","also","constructor","arguments","."]
code: def configuration(self) -> dict[str, Any]:
      """Returns the configuration of the knowledge base.
  
      By default, returns a dictionary containing the attributes of `self` which are also
      constructor arguments.
      """
      # Note: This is perhaps a bit too generic. But it works for any class or subclass.
      # We could probably move this to a `Configured` mixin class eventually.
      init_signature = inspect.signature(type(self).__init__)
      init_arguments_attributes = {
          name: getattr(self, name)
          for name in init_signature.parameters
          if hasattr(self, name)
      }
      # Get the configuration of attributes if needed.
      init_argument_configurations = {
          name: value.configuration
          if hasattr(value, "configuration")
          else value
          for name, value in init_arguments_attributes.items()
      }
      return {type(self).__qualname__: init_argument_configurations}
  
file_path: orion/src/orion/core/worker/warm_start/knowledge_base.py
imports: from __future__ import annotations
  import inspect
  import typing
  from functools import partial
  from logging import getLogger
  from typing import Any, Callable, Iterable
label_desc: Use image node_id 5 for calling the KnowledgeBase obj's underlying member method code with example usage: obj.configuration() and returns: dict