keras-team/autokeras

Specify hyperparameter ranges for blocks

开放

#1,420 创建于 2020年11月5日

 (20 条评论) (0 个反应) (0 位负责人)Python (1,420 个派生)batch import
contribution welcomefeature requestgood first issuepinned

仓库指标

星标
 (9,025 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Feature Description

We want to enable the users to specify the value ranges for any argument in the blocks. The following code example shows a typical use case. The users can specify the number of units in a DenseBlock to be either 10 or 20.

Code Example

import autokeras as ak
from kerastuner.engine.hyperparameters import Choice

input_node = ak.ImageInput()
output_node = ak.DenseBlock(num_units=Choice("num_units", [10, 20]))(input_node)
output_node = ak.ClassificationHead()(output_node)
model = ak.AutoModel(input_node, output_node)

Note

Each pull request should only change one hyperparameter in one of the blocks.

Solution

Example pull requests are #1419 #1425 . Here are the steps to follow:

  1. You can just change any other argument in any other block supported by AutoKeras, as shown here.
  2. Change the docstring. example
  3. Make sure you imported the module. from kerastuner.engine import hyperparameters.
  4. Change the typing of the argument. example
  5. Change the saving mechanism to serialized objects. example
  6. Change the loading mechanism to deserialized objects. example
  7. Change how we initialize the hyperparameter to self. example Copy from where it is originally defined. example
  8. Change how we use it. example

贡献者指南