neural_compressor.experimental.nas.nas_utils

Common methods for NAS.

Module Contents

Functions

nas_registry(nas_method)

Decorate the NAS subclasses.

create_search_space_pool(search_space[, idx])

Create all the samples from the search space.

find_pareto_front(metrics)

Find the pareto front points, assuming all metrics are "higher is better".

neural_compressor.experimental.nas.nas_utils.nas_registry(nas_method)

Decorate the NAS subclasses.

The class decorator used to register all NAS subclasses.

Parameters:

nas_method (str) – The string of supported NAS Method.

Returns:

The class of register.

Return type:

cls

neural_compressor.experimental.nas.nas_utils.create_search_space_pool(search_space, idx=0)

Create all the samples from the search space.

Parameters:
  • search_space (dict) – A dict defining the search space.

  • idx (int) – An index for indicating which key of search_space to enumerate.

Returns:

A list of all the samples from the search space.

neural_compressor.experimental.nas.nas_utils.find_pareto_front(metrics)

Find the pareto front points, assuming all metrics are “higher is better”.

Parameters:

metrics (numpy array or list) – An (n_points, n_metrics) array.

Returns:

An array of indices of pareto front points. It is a (n_pareto_points, ) integer array of indices.