Path: blob/master/templates/keras_tuner/api/hypermodels/index.md
5304 views
KerasTuner HyperModels
The HyperModel base class makes the search space better encapsulated for sharing and reuse. A HyperModel subclass only needs to implement a build(self, hp) method, which creates a keras.Model using the hp argument to define the hyperparameters and returns the model instance. A simple code example is shown as follows.
You can pass a HyperModel instance to the Tuner as the search space.
There are also some built-in HyperModel subclasses (e.g. HyperResNet, HyperXception) for the users to directly use so that the users don't need to write their own search spaces.
{{toc}}