Block

[source]

ImageBlock class

autokeras.hypermodel.hyperblock.ImageBlock(
    block_type=None, normalize=None, augment=None, seed=None, **kwargs
)

Block for image data.

The image blocks is a block choosing from ResNetBlock, XceptionBlock, ConvBlock, which is controlled by a hyperparameter, 'block_type'.

Arguments

  • block_type: String. 'resnet', 'xception', 'vanilla'. The type of HyperBlock to use. If unspecified, it will be tuned automatically.
  • normalize: Boolean. Whether to channel-wise normalize the images. If unspecified, it will be tuned automatically.
  • augment: Boolean. Whether to do image augmentation. If unspecified, it will be tuned automatically.

[source]

TextBlock class

autokeras.hypermodel.hyperblock.TextBlock(vectorizer=None, pretraining=None, **kwargs)

Block for text data.

Arguments

  • vectorizer: String. 'sequence' or 'ngram'. If it is 'sequence', TextToIntSequence will be used. If it is 'ngram', TextToNgramVector will be used. If unspecified, it will be tuned automatically.
  • pretraining: Boolean. Whether to use pretraining weights in the N-gram vectorizer. If unspecified, it will be tuned automatically.

[source]

StructuredDataBlock class

autokeras.hypermodel.hyperblock.StructuredDataBlock(
    feature_engineering=True, module_type=None, seed=None, **kwargs
)

Block for structured data.

Arguments

  • feature_engineering: Boolean. Whether to use feature engineering block. Defaults to True. If specified as None, it will be tuned automatically.
  • module_type: String. 'dense' or 'lightgbm'. If it is 'dense', DenseBlock will be used. If it is 'lightgbm', LightGBMBlock will be used. If unspecified, it will be tuned automatically.
  • seed: Int. Random seed.

[source]

ResNetBlock class

autokeras.hypermodel.block.ResNetBlock(version=None, pooling=None, **kwargs)

Block for ResNet.

Arguments

  • version: String. 'v1', 'v2' or 'next'. The type of ResNet to use. If left unspecified, it will be tuned automatically.
  • pooling: String. 'avg', 'max'. The type of pooling layer to use. If left unspecified, it will be tuned automatically.

[source]

XceptionBlock class

autokeras.hypermodel.block.XceptionBlock(
    activation=None, initial_strides=None, num_residual_blocks=None, pooling=None, **kwargs
)

XceptionBlock.

An Xception structure, used for specifying your model with specific datasets.

The original Xception architecture is from https://arxiv.org/abs/1610.02357. The data first goes through the entry flow, then through the middle flow which is repeated eight times, and finally through the exit flow.

This XceptionBlock returns a similar architecture as Xception except without the last (optional) fully connected layer(s) and logistic regression. The size of this architecture could be decided by HyperParameters, to get an architecture with a half, an identical, or a double size of the original one.

Arguments

  • activation: String. 'selu' or 'relu'. If left unspecified, it will be tuned automatically.
  • initial_strides: Int. If left unspecified, it will be tuned automatically.
  • num_residual_blocks: Int. If left unspecified, it will be tuned automatically.
  • pooling: String. 'ave', 'flatten', or 'max'. If left unspecified, it will be tuned automatically.

[source]

ConvBlock class

autokeras.hypermodel.block.ConvBlock(kernel_size=None, num_blocks=None, separable=None, **kwargs)

Block for vanilla ConvNets.

Arguments

  • kernel_size: Int. If left unspecified, it will be tuned automatically.
  • num_blocks: Int. The number of conv blocks. If left unspecified, it will be tuned automatically.
  • separable: Boolean. Whether to use separable conv layers. If left unspecified, it will be tuned automatically.

[source]

RNNBlock class

autokeras.hypermodel.block.RNNBlock(
    return_sequences=False, bidirectional=None, num_layers=None, layer_type=None, **kwargs
)

An RNN Block.

Arguments

  • return_sequences: Boolean. Whether to return the last output in the output sequence, or the full sequence. Defaults to False.
  • bidirectional: Boolean. Bidirectional RNN. If left unspecified, it will be tuned automatically.
  • num_layers: Int. The number of layers in RNN. If left unspecified, it will be tuned automatically.
  • layer_type: String. 'gru' or 'lstm'. If left unspecified, it will be tuned automatically.

[source]

Merge class

autokeras.hypermodel.block.Merge(merge_type=None, **kwargs)

Merge block to merge multiple nodes into one.

Arguments

  • merge_type: String. 'add' or 'concatenate'. If left unspecified, it will be tuned automatically.