class_docstr: Configuration options for the training of the Profet meta-model.
class_docstr_tok: ["Configuration","options","for","the","training","of","the","Profet","meta-model","."]
docstr: Load the result of the `get_task_network` function stored in the pickle file.
  
  Parameters
  ----------
  checkpoint_file : Union[str, Path]
      Path to a pickle file. The file is expected to contain a serialized dictionary, with keys
      "benchmark", "size", "network", and "h".
  
  Returns
  -------
  Tuple[Any, np.ndarray]
      The surrogate model for the objective, as well as an array of sampled task features.
docstr_tok: ["Load","the","result","of","the","`","get_task_network","`","function","stored","in","the","pickle","file",".","Parameters","--","--","--","--","--","checkpoint_file",":","Union","[","str",",","Path","]","Path","to","a","pickle","file",".","The","file","is","expected","to","contain","a","serialized","dictionary",",","with","keys","``","benchmark","''",",","``","size","''",",","``","network","''",",","and","``","h","''",".","Returns","--","--","--","-","Tuple","[","Any",",","np.ndarray","]","The","surrogate","model","for","the","objective",",","as","well","as","an","array","of","sampled","task","features","."]
code: def load_task_network(
      self,
      checkpoint_file: Union[str, Path],
  ) -> Tuple[Any, np.ndarray]:
      """Load the result of the `get_task_network` function stored in the pickle file.
  
      Parameters
      ----------
      checkpoint_file : Union[str, Path]
          Path to a pickle file. The file is expected to contain a serialized dictionary, with keys
          "benchmark", "size", "network", and "h".
  
      Returns
      -------
      Tuple[Any, np.ndarray]
          The surrogate model for the objective, as well as an array of sampled task features.
      """
      with open(checkpoint_file, "rb") as f:
          state = pickle.load(f)
  
      if state["benchmark"] != self.benchmark:
          raise RuntimeError(
              f"Trying to load model for benchmark {self.benchmark} from checkpoint that "
              f"contains data from benchmark {state['benchmark']}."
          )
      network = type(self).get_architecture(
          input_dimensionality=state["size"]
      )
      network.load_state_dict(state["network"])
      h = state["h"]
  
      return network, h
  
imports: import json
  import pickle
  import warnings
  from abc import ABC
  from copy import deepcopy
  from dataclasses import dataclass
  from logging import getLogger
  from pathlib import Path
  from typing import Any, Callable, ClassVar, Optional, Tuple, Union
  import numpy
label_desc: Use image node_id 8 for calling the MetaModelConfig obj's underlying member method code with example usage: obj.load_task_network(checkpoint_file) and returns: network,  h