class_docstr: Suggests an architecture based on the Harmonica algorithm.
docstr: Translates the trial architecture to a categorical assignment.
docstr_tok: ["Translates","the","trial","architecture","to","a","categorical","assignment","."]
code: def translate_architecture_to_feature_assignment(self, architecture):
      """Translates the trial architecture to a categorical assignment."""
      category_size = len(self._block_indices)
      # TODO(b/172564129): Change to use architecture.size instead of _num_params
      x_real = np.empty(self._num_params * category_size)
      x_imag = np.empty(self._num_params * category_size)
      depth = 0
      for block in architecture:
          # These are connector blocks (non-trainable) that connect CNN and DNN.
          # They should not be a part of out search problem.
          if (
              block == block_builder.BlockType.FLATTEN
              or block == block_builder.BlockType.DOWNSAMPLE_FLATTEN
              or block
              == block_builder.BlockType.PLATE_REDUCTION_FLATTEN
          ):
              continue
          index = self._block_indices.index(block)
          for t in range(category_size):
              value = self.basis_function(t, index)
              x_real[category_size * depth + t] = value.real
              x_imag[category_size * depth + t] = value.imag
          depth += 1
      return [x_real, x_imag]
  
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 4 for calling the Harmonica obj's underlying member method code with example usage: obj.translate_architecture_to_feature_assignment(architecture) and returns: list