Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 2.21 KB

Supported_Layers.md

File metadata and controls

47 lines (35 loc) · 2.21 KB

Supported Layers

This is a list of the layers/ nodes that are currently supported. We plan to keep adding more and hope that the community will help with this as well.

In Metal, the basic unit which holds data between layers is the MTLTexture which is contained in an MPSImage. A texture can have an arbitrary amount of feature channels (it is not limited to three or four)

The implemented layers are:

  • Add: Sums two textures element-wise. Both textures have to be of the same size
  • Concat: Concatenates the inputs along certain axis
  • Convolution: Wrapper for MPSCNNConvolution
  • ConvTranspose: Represents a transposed convolution
  • FullyConnected: Represents a Fully connected (or Dense) layer
  • InstanceNorm: Instance Normalization
  • LRN: Local Response Normalization
  • Pooling: Implements max and average pooling
  • Neuron: Activation neurons such as ReLU, TanH, Sigmoid, Linear
  • Softmax: Implements a Softmax
  • SpatialNorm: Spatial Normalization

Also there are some layers that can be used for pre and post processing or which are helpers for special cases:

  • BGRAtoRGBA: Transforms an image from BGRA to RGBA order
  • Crop: Crops an image
  • Dummy: Helper node used in special cases. Will be removed from the execution list in network.initialize().
  • Identity: Returns the same image. Used in some special cases
  • ImageLinearTransform: Helper used when the output of the network is an image (not an array of probabilities)
  • Scale: Scales a texture to a defined size
  • Start: Starting node of a network

Last but not least, there is a CompositeLayer included:

  • Residual: A Residual layer contains a group of sublayers which are executed and the output is the result of this sublayers added to the input of the residual layer.

TensorFlow Mapping

The following are the TensorFlow ops that are mapped to Bender layers:

  • Add -> Add (works for two textures/tensors of the same size)
  • ConcatV2 -> Concat
  • Conv2D -> Convolution
  • Conv2Dtranspose -> ConvTranspose
  • Matmul + BiasAdd -> FullyConnected
  • MaxPooling and AvgPooling -> Pooling
  • Relu, Tanh, Sigmoid -> Neuron
  • Softmax -> Softmax