Sequential

class dragon.vm.tensorflow.keras.Sequential(
  layers=None,
  name=None
)[source]

Stack a group of layers and run sequentially.

Examples:

conv_triplet = tf.keras.Sequential([
    tf.keras.layers.Conv2D(2, 3),
    tf.keras.layers.BatchNormalization(),
    tf.keras.layers.ReLU(inplace=True),
])

__init__

Sequential.__init__(
  layers=None,
  name=None
)[source]

Create a Sequential layer.

Parameters:

Properties

layers

Sequential.layers

Return the stacked layers.

Returns:
Sequence[dragon.vm.tensorflow.keras.layers.Layer] – The sequence containing layers.

Methods

add

Sequential.add(layer)[source]

Add a layer into the stack.

Parameters:

load_weights

Layer.load_weights(
  filepath,
  verbose=False
)[source]

Load the value of weights from a binary file.

Parameters:
  • filepath (str, required) – The path of weights file to load.
  • verbose (bool, optional, default=False) – True to display the weights info.

pop

Sequential.pop()[source]

Remove the last layer in the stack.

save_weights

Layer.save_weights(
  filepath,
  save_format=None
)[source]

Save the value of weights into a binary file.

Parameters:
  • filepath (str, required) – The path of weights file to save.
  • save_format ({'tf', 'h5', 'pkl'}, optional) – The determined saving format.