Predictors#

DNN Ensemble#

class archai.discrete_search.predictors.dnn_ensemble.PredictiveDNNEnsemble(num_ensemble_members: int | None = 5, num_layers: int | None = 5, width: int | None = 64, lr: float | None = 0.0001, num_tr_steps: int | None = 2000, replace_nan_value: float = -1.0, device: str | None = 'cuda')[source]#

Deep Neural Network Ensemble predictor.

Predicts the outcome of a set of expensive objectives using an ensemble of MLP models.

to_cuda() None[source]#

Moves the predictor to CUDA.

to_cpu() None[source]#

Moves the predictor to CPU.

fit(X: ndarray, y: ndarray) None[source]#

Fit a predictor model using an array of encoded architectures (N, #features) and a multi-dimensional array of targets (N, #targets).

Parameters:
  • encoded_archs – (N, #features) numpy array.

  • y – (N, #targets) numpy array.

predict(X: ndarray) MeanVar[source]#

Predict the performance of an array of architectures encoded by by a subclass implementation of BayesOptSearchSpaceBase.encode().

Parameters:

encoded_archs – Array of encoded architectures.

Returns:

Named tuple with mean (N, #targets) and var (N, #targets) arrays.

class archai.discrete_search.predictors.dnn_ensemble.FFEnsembleMember(num_objectives: int | None = 1, input_feat_len: int | None = 128, num_layers: int | None = 10, width: int | None = 20)[source]#

Feedforward ensemble member.

forward(x: Tensor) Tensor[source]#

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool#