Reader small image

You're reading from  Automated Machine Learning with AutoKeras

Product typeBook
Published inMay 2021
Reading LevelBeginner
PublisherPackt
ISBN-139781800567641
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Luis Sobrecueva
Luis Sobrecueva
author image
Luis Sobrecueva

Luis Sobrecueva is a senior software engineer and ML/DL practitioner currently working at Cabify. He has been a contributor to the OpenAI project as well as one of the contributors to the AutoKeras project.
Read more about Luis Sobrecueva

Right arrow

Customizing the model search space

We can customize the model's search to restrict the search space by using AutoModel instead of TextClassifier, for example, by setting TextBlock for some specific configurations.

In the following code snippet, we're telling AutoKeras to only generate models that use 'ngram' to vectorize the sentences. Remember that if we do not specify any of these arguments, AutoKeras will automatically try all the possible combinations until the number reaches the max_trial parameter:

input_node = ak.TextInput()
output_node = ak.TextBlock(block_type="ngram")(input_node)
output_node = ak.ClassificationHead()(output_node)
clf = ak.AutoModel(inputs=input_node, 
                   outputs=output_node, overwrite=True,
                   max_trials...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Automated Machine Learning with AutoKeras
Published in: May 2021Publisher: PacktISBN-13: 9781800567641

Author (1)

author image
Luis Sobrecueva

Luis Sobrecueva is a senior software engineer and ML/DL practitioner currently working at Cabify. He has been a contributor to the OpenAI project as well as one of the contributors to the AutoKeras project.
Read more about Luis Sobrecueva