Tensorflow models

u_net(images, depth, init_filters, output=None, is_training=True, verbose=0)[source]

U-net implementation.

Parameters
  • images (4d tensor) – Input tensor.

  • depth (int) – Depth of the U-net.

  • init_filters (int) – Number of filters in the first conv block.

  • output (dict) – Output conv block config.

  • is_training (bool) – Phase of training for batchnorm. Default to True.

  • verbose (int) – Level for information messages. Default to 0.

Returns

up – Output tensor.

Return type

4d tensor

conv_block(x, layout, filters=None, transpose=False, rate=0.1, activation=None, is_training=True)[source]

Convolutional block.

Parameters
  • x (tensor) – Input tensor.

  • layout (str) – Layout of layers. Can contain “c” for convolution, “a” for activation, “n” for batchnorm, “p” for maxpooling, “d” for dropout. E.g. of layout: “ccnapd”.

  • filters (int, list or None) – Number of filters for convolutions. Can be a single number (all convolutions will have the same number of filters), a list of the same length as a count of letters “c” in the layout, or None if the layout contains no “c”.

  • transpose (bool) – If true, transposed convolutions are used.

  • rate (float) – Dropout rate parameter. Default to 0.1.

  • activation (function) – Activation function. If not specified activation is tf.nn.elu.

  • is_training (bool) – Phase of training for batchnorm. Default to True.

Returns

x – Output tensor.

Return type

tensor