Nueral Network Search Module (API Reference)

Search a best neural network model with kerastuner based on data we have.

class automl.neural_network_search.DNNSearch(n_classes, use_dropout=False)

Bases: automl.neural_network_search.SearchModel

build(hp)

Builds a model.

Parameters

hp – A HyperParameters instance.

Returns

A model instance.

class automl.neural_network_search.NeuralModelSearch(objective='val_accuracy', max_trials=5, executions_per_trial=1, directory=None, project_name=None, algorithm_list=None, tuning_algorithm='RandomSearch', num_best_models=5, models_path=None, task_type='classification')

Bases: object

Main class for caller class to find best models.

evaluate_trained_models(best_models, x, y)

After training, evaluate will get best trained model, get test score and save them into disk.

Parameters
  • best_models ([type]) – [description]

  • x ([type]) – [description]

  • y ([type]) – [description]

fit(x, y, epochs=10, val_x=None, val_y=None, validation_split=0.2, evaluate=True)

Search logic to find best model with support classification and regression

Added with a evaluate score list like, so that we could make it with Grid search model:

estimator_train_name = estimator.name + “_” + str(mean_train_score) self.score_list.append((estimator_train_name, estimator, mean_test_score))

Parameters
  • x ([type]) – [description]

  • y ([type]) – [description]

  • epochs ([type], optional) – [description]. Defaults to 10.

  • val_x ([type], optional) – [description]. Defaults to None.

  • val_y ([type], optional) – [description]. Defaults to None.

  • validation_split ([type], optional) – [description]. Defaults to 0.2.

  • evaluate ([type], optional) – [description]. Defaults to True.

class automl.neural_network_search.SearchModel(n_classes, algorithm_name='DNN', use_dropout=True)

Bases: keras_tuner.engine.hypermodel.HyperModel

build(hp)

Builds a model.

Parameters

hp – A HyperParameters instance.

Returns

A model instance.