LayerList¶
- class
dragon.vm.tensorlayer.layers.
LayerList
(
layers,
name=None
)[source]¶ The sequential layer to stack a group of layers.
__init__¶
LayerList.
__init__
(
layers,
name=None
)[source]¶Create a new
LayerList
.- Parameters:
- layers (Sequence[dragon.vm.tensorlayer.layers.Layer]) – The layers to stack.
- name (str, optional) – The layer name.
Properties¶
all_weights¶
LayerList.
all_weights
¶Return all the weights, both trainable and non-trainable.
- Returns:
- Sequence[dragon.Tensor] – The weights sequence.
nontrainable_weights¶
LayerList.
nontrainable_weights
¶Return the non-trainable weights.
- Returns:
- Sequence[dragon.Tensor] – The weights sequence.
Methods¶
forward¶
LayerList.
forward
(
inputs,
*args,
**kwargs
)[source]¶Forward the computation sequentially.
- Parameters:
- inputs (Sequence[dragon.Tensor]) – The inputs.
- Returns:
Sequence[dragon.Tensor] – The outputs.
load_weights¶
Module.
load_weights
(
filepath,
format=None,
skip=False,
verbose=False
)[source]Load model weights from a binary file.
- Parameters:
- filepath (str) – The path of weights file.
- format ({'hdf5', 'npz', 'pkl', 'npz_dict'}, optional) – The optional saving format.
- skip (bool, optional, default=False) –
True
to skip the modules which is not found. - verbose (bool, optional, default=False) –
True
to print the matched weights.
save_weights¶
Module.
save_weights
(
filepath,
format=None
)[source]Save weights into a binary file.
- Parameters:
- filepath (str) – The path of weights file.
- format ({'hdf5', 'npz', 'pkl', 'npz_dict'}, optional) – The optional saving format.