converters.keras._layers

Module Contents

Functions

_get_recurrent_activation_name_from_keras(activation)
_get_activation_name_from_keras_layer(keras_layer)
_get_elementwise_name_from_keras_layer(keras_layer) Get the keras layer name from the activation name.
_same_elements_per_channel(x) Test if a 3D (H,W,C) matrix x has the same element in each (H,W) matrix for each channel
convert_dense(builder,layer,input_names,output_names,keras_layer) Convert a dense layer from keras to coreml.
convert_activation(builder,layer,input_names,output_names,keras_layer) Convert an activation layer from keras to coreml.
convert_merge(builder,layer,input_names,output_names,keras_layer) Convert concat layer from keras to coreml.
convert_pooling(builder,layer,input_names,output_names,keras_layer) Convert pooling layer from keras to coreml.
convert_padding(builder,layer,input_names,output_names,keras_layer) Convert padding layer from keras to coreml.
convert_cropping(builder,layer,input_names,output_names,keras_layer) Convert padding layer from keras to coreml.
convert_reshape(builder,layer,input_names,output_names,keras_layer)
convert_upsample(builder,layer,input_names,output_names,keras_layer) Convert convolution layer from keras to coreml.
convert_convolution(builder,layer,input_names,output_names,keras_layer) Convert convolution layer from keras to coreml.
convert_convolution1d(builder,layer,input_names,output_names,keras_layer) Convert convolution layer from keras to coreml.
convert_lstm(builder,layer,input_names,output_names,keras_layer) Convert an LSTM layer from keras to coreml.
convert_simple_rnn(builder,layer,input_names,output_names,keras_layer) Convert an SimpleRNN layer from keras to coreml.
convert_gru(builder,layer,input_names,output_names,keras_layer) Convert a GRU layer from keras to coreml.
convert_bidirectional(builder,layer,input_names,output_names,keras_layer) Convert a bidirectional layer from keras to coreml.
convert_batchnorm(builder,layer,input_names,output_names,keras_layer) Parameters
convert_flatten(builder,layer,input_names,output_names,keras_layer) Convert a flatten layer from keras to coreml.
convert_softmax(builder,layer,input_names,output_names,keras_layer) Convert a softmax layer from keras to coreml.
convert_permute(builder,layer,input_names,output_names,keras_layer) Convert a softmax layer from keras to coreml.
convert_embedding(builder,layer,input_names,output_names,keras_layer) Convert a dense layer from keras to coreml.
convert_repeat_vector(builder,layer,input_names,output_names,keras_layer)
default_skip(builder,layer,input_names,output_names,keras_layer) Layers that can be skipped (because they are train time only.
_get_recurrent_activation_name_from_keras(activation)
_get_activation_name_from_keras_layer(keras_layer)
_get_elementwise_name_from_keras_layer(keras_layer)

Get the keras layer name from the activation name.

_same_elements_per_channel(x)

Test if a 3D (H,W,C) matrix x has the same element in each (H,W) matrix for each channel

convert_dense(builder, layer, input_names, output_names, keras_layer)

Convert a dense layer from keras to coreml.

Parameters keras_layer: layer ———-

A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_activation(builder, layer, input_names, output_names, keras_layer)

Convert an activation layer from keras to coreml.

keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_merge(builder, layer, input_names, output_names, keras_layer)

Convert concat layer from keras to coreml.

keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_pooling(builder, layer, input_names, output_names, keras_layer)

Convert pooling layer from keras to coreml.

keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_padding(builder, layer, input_names, output_names, keras_layer)

Convert padding layer from keras to coreml. Keras only supports zero padding at this time. Parameters ———- keras_layer: layer

A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_cropping(builder, layer, input_names, output_names, keras_layer)

Convert padding layer from keras to coreml. Keras only supports zero padding at this time. Parameters ———- keras_layer: layer

A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_reshape(builder, layer, input_names, output_names, keras_layer)
convert_upsample(builder, layer, input_names, output_names, keras_layer)

Convert convolution layer from keras to coreml.

keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_convolution(builder, layer, input_names, output_names, keras_layer)

Convert convolution layer from keras to coreml.

keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_convolution1d(builder, layer, input_names, output_names, keras_layer)

Convert convolution layer from keras to coreml.

keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_lstm(builder, layer, input_names, output_names, keras_layer)

Convert an LSTM layer from keras to coreml.

keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_simple_rnn(builder, layer, input_names, output_names, keras_layer)

Convert an SimpleRNN layer from keras to coreml.

keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_gru(builder, layer, input_names, output_names, keras_layer)

Convert a GRU layer from keras to coreml.

keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_bidirectional(builder, layer, input_names, output_names, keras_layer)
Convert a bidirectional layer from keras to coreml.
Currently assumes the units are LSTMs.
keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_batchnorm(builder, layer, input_names, output_names, keras_layer)

Parameters keras_layer: layer

A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_flatten(builder, layer, input_names, output_names, keras_layer)

Convert a flatten layer from keras to coreml.

Parameters keras_layer: layer ———-

A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_softmax(builder, layer, input_names, output_names, keras_layer)

Convert a softmax layer from keras to coreml.

Parameters keras_layer: layer ———-

A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_permute(builder, layer, input_names, output_names, keras_layer)

Convert a softmax layer from keras to coreml.

Parameters keras_layer: layer ———-

A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_embedding(builder, layer, input_names, output_names, keras_layer)

Convert a dense layer from keras to coreml.

Parameters keras_layer: layer ———-

A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
convert_repeat_vector(builder, layer, input_names, output_names, keras_layer)
default_skip(builder, layer, input_names, output_names, keras_layer)

Layers that can be skipped (because they are train time only.