deephyper.nas.operation

deephyper.nas.operation

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

Bases: deephyper.nas.operation._base.Operation

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.

init(current_node)[source]

Preprocess the current operation.

class deephyper.nas.operation.AddByProjecting(search_space, stacked_nodes=None, activation=None, axis=- 1)[source]

Bases: deephyper.nas.operation._base.Operation

Add operation. If tensors are of different shapes a projection 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.

init(current_node)[source]

Preprocess the current operation.

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

Bases: deephyper.nas.operation._base.Operation

Concatenate operation.

Parameters
  • graph

  • node (Node) –

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

  • axis (int) – axis to concatenate

init(current_node)[source]

Preprocess the current operation.

class deephyper.nas.operation.Connect(search_space, source_node, *args, **kwargs)[source]

Bases: deephyper.nas.operation._base.Operation

Connection node.

Represents a possibility to create a connection between n1 -> n2.

Parameters
  • graph (nx.DiGraph) – a graph

  • source_node (Node) – source

init(current_node)[source]

Set the connection in the search_space graph from n1 -> n2.

class deephyper.nas.operation.Identity[source]

Bases: deephyper.nas.operation._base.Operation

init(current_node)

Preprocess the current operation.

class deephyper.nas.operation.Operation(layer: keras.engine.base_layer.Layer)[source]

Bases: object

Interface of an operation.

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

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

init(current_node)[source]

Preprocess the current operation.

class deephyper.nas.operation.Tensor(tensor, *args, **kwargs)[source]

Bases: deephyper.nas.operation._base.Operation

init(current_node)

Preprocess the current operation.

class deephyper.nas.operation.Zero[source]

Bases: deephyper.nas.operation._base.Operation

init(current_node)

Preprocess the current operation.

deephyper.nas.operation.operation(cls)[source]

Dynamically create a sub-class of Operation from a Keras layer.