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","."]
code: def __init__(
      self,
      storage: BaseStorageProtocol,
      similarity_metric: Callable[
          [ExperimentConfig, ExperimentConfig], float
      ]
      | None = None,
  ):
      self.storage = storage
      self.similarity_metric = similarity_metric
  
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 1 to create a new KnowledgeBase object  with example: obj = KnowledgeBase(storage, similarity_metric)