Operations

class deephyper.nas.space.op.basic.Operation(layer: tensorflow.python.keras.engine.base_layer.Layer)[source]

Interface of an operation.

>>> import tensorflow as tf
>>> from deephyper.nas.space.op.op1d import Operation
>>> Operation(layer=tf.keras.layers.Dense(10))
Dense
Parameters

layer (Layer) – a tensorflow.keras.layers.Layer.

Operation 1D (Input is vector)

class deephyper.nas.space.op.op1d.Identity[source]
class deephyper.nas.space.op.op1d.Dense(units, activation=None, *args, **kwargs)[source]

Multi Layer Perceptron operation.

Help you to create a perceptron with n layers, m units per layer and an activation function.

Parameters
  • units (int) – number of units per layer.

  • activation – an activation function from tensorflow.

class deephyper.nas.space.op.op1d.Dropout(rate)[source]

Dropout operation.

Help you to create a dropout operation.

Parameters

rate (float) – rate of deactivated inputs.

class deephyper.nas.space.op.op1d.Conv1D(filter_size, num_filters=1, strides=1, padding='same')[source]

Convolution for one dimension.

Help you to create a one dimension convolution operation.

Parameters
  • filter_size (int) – size kernels/filters

  • num_filters (int) – number of kernels/filters

  • strides (int) –

  • padding (str) – ‘same’ or ‘valid’

class deephyper.nas.space.op.op1d.MaxPooling1D(pool_size, strides=1, padding='valid', data_format='channels_last')[source]

MaxPooling over one dimension.

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

  • strides (int, optional) – Defaults to 1. [description]

  • padding (str, optional) – Defaults to ‘valid’. [description]

  • data_format (str, optional) – Defaults to ‘channels_last’. [description]

class deephyper.nas.space.op.op1d.Flatten(data_format=None)[source]

Flatten operation.

Parameters

data_format (str, optional) – Defaults to None.

Merge Operations

class deephyper.nas.space.op.merge.Concatenate(search_space, stacked_nodes=None, axis=- 1)[source]

Concatenate operation.

Parameters
  • graph

  • node (Node) –

  • stacked_nodes (list(Node)) – nodes to concatenate

  • axis (int) – axis to concatenate

class deephyper.nas.space.op.merge.AddByPadding(search_space, stacked_nodes=None, activation=None, axis=- 1)[source]

Add operation. If tensor are of different shapes a padding will be applied before adding them.

Parameters
  • search_space (KSearchSpace) – [description]. Defaults to None.

  • activation ([type], optional) – Activation function to apply after adding (‘relu’, tanh’, ‘sigmoid’…). Defaults to None.

  • stacked_nodes (list(Node)) – nodes to add.

  • axis (int) – axis to concatenate.

Define a new Operation