class_docstr: Suggests an architecture based on the Harmonica algorithm.
docstr: Initializes the Harmonica instance.
  
  Args:
    phoenix_spec: PhoenixSpec proto.
    alpha: The alpha of lasso solver (please read on lasso solver to
      understand this constant. In a nutshell, this control regularization for
      lasso. alpha equal zero means regular linear regression - however, try
      not to use alpha = 0 because of numerical stability of the lasso
      implementation with that value.
    degree: The degree (int) of the polynomial we try to fit the data with.
    n_mono: The number of monomials in the function that fits the data. I.e.,
      we take the n_mono highest coefficients in the function and remove all
      the rest.
    min_for_regression: Minimal amount (int) of data point before applying
      regression.
    num_random_samples: int, must be greater than 1. Specifies the amount of
      architectures to sample and predict the loss for before proposing a new
      architecture to test.
    num_of_restarts: int, number of times to run the linear regression for
      determining the relevant variables.
    seed: int, for the np.random.
    debug_mode: If True, writes the coefficients of the model to the model
      directory for debugging purposes.
docstr_tok: ["Initializes","the","Harmonica","instance",".","Args",":","phoenix_spec",":","PhoenixSpec","proto",".","alpha",":","The","alpha","of","lasso","solver","(","please","read","on","lasso","solver","to","understand","this","constant",".","In","a","nutshell",",","this","control","regularization","for","lasso",".","alpha","equal","zero","means","regular","linear","regression","-","however",",","try","not","to","use","alpha","=","0","because","of","numerical","stability","of","the","lasso","implementation","with","that","value",".","degree",":","The","degree","(","int",")","of","the","polynomial","we","try","to","fit","the","data","with",".","n_mono",":","The","number","of","monomials","in","the","function","that","fits","the","data",".","I.e.",",","we","take","the","n_mono","highest","coefficients","in","the","function","and","remove","all","the","rest",".","min_for_regression",":","Minimal","amount","(","int",")","of","data","point","before","applying","regression",".","num_random_samples",":","int",",","must","be","greater","than","1",".","Specifies","the","amount","of","architectures","to","sample","and","predict","the","loss","for","before","proposing","a","new","architecture","to","test",".","num_of_restarts",":","int",",","number","of","times","to","run","the","linear","regression","for","determining","the","relevant","variables",".","seed",":","int",",","for","the","np.random",".","debug_mode",":","If","True",",","writes","the","coefficients","of","the","model","to","the","model","directory","for","debugging","purposes","."]
code: def __init__(
      self,
      phoenix_spec,
      alpha=0.05,
      degree=2,
      n_mono=10,
      min_for_regression=3,
      num_random_samples=10000,
      num_of_restarts=3,
      seed=None,
      debug_mode=False,
  ):
      """Initializes the Harmonica instance.
  
      Args:
        phoenix_spec: PhoenixSpec proto.
        alpha: The alpha of lasso solver (please read on lasso solver to
          understand this constant. In a nutshell, this control regularization for
          lasso. alpha equal zero means regular linear regression - however, try
          not to use alpha = 0 because of numerical stability of the lasso
          implementation with that value.
        degree: The degree (int) of the polynomial we try to fit the data with.
        n_mono: The number of monomials in the function that fits the data. I.e.,
          we take the n_mono highest coefficients in the function and remove all
          the rest.
        min_for_regression: Minimal amount (int) of data point before applying
          regression.
        num_random_samples: int, must be greater than 1. Specifies the amount of
          architectures to sample and predict the loss for before proposing a new
          architecture to test.
        num_of_restarts: int, number of times to run the linear regression for
          determining the relevant variables.
        seed: int, for the np.random.
        debug_mode: If True, writes the coefficients of the model to the model
          directory for debugging purposes.
      """
      # Spec of phoenix
      self._phoenix_spec = phoenix_spec
      # The alpha of lasso solver (please read on lasso solver to understand this
      # constant. In a nutshell, this control regularization for lasso. alpha
      # equal zero means regular linear regression - however, try not to use
      # alpha = 0 because of numerical stability of the lasso implementation with
      # that value.
      self._alpha = alpha
      # The degree of the polynomial we try to fit the data with.
      self._degree = degree
      # The number of monomials in the function that fits the data. I.e., we take
      # the n_mono highest coefficients in the function and remove all the rest.
      self._n_mono = n_mono
      # Seed for np.random.randint
      self._seed = seed
      self._num_params = self._phoenix_spec.minimum_depth
      # Blocktype to index -- needed to translate block type to a one-hot vector.
      self._block_indices = [
          block_builder.BlockType[block_type]
          for block_type in self._phoenix_spec.blocks_to_use
      ]
      # Minimal amount of data point before applying regression.
      self._min_for_regression = min_for_regression
      # Must be greater than 1.
      self._num_random_samples = num_random_samples
      assert self._num_random_samples > 1
      self._num_of_restarts = num_of_restarts
      self._debug_mode = debug_mode
  
imports: import cmath
  import os
  from absl import logging
  from model_search import block_builder
  from model_search.architecture import architecture_utils
  from model_search.search import search_algorithm
  import numpy
  from sklearn import linear_model
  from sklearn import preprocessing
  import tensorflow.compat.v2
label_desc: Use image node_id 1 to create a new Harmonica object from inherited base classes: search_algorithm with example: obj = Harmonica(phoenix_spec, alpha, degree, n_mono, min_for_regression, num_random_samples, num_of_restarts, seed, debug_mode)