File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
bayesflow/networks/sequential Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 77
88@serializable ("bayesflow.networks" )
99class Sequential (keras .Layer ):
10+ """
11+ A custom sequential model for managing a sequence of Keras layers.
12+
13+ This class extends `keras.Layer` and provides functionality for building,
14+ calling, and serializing a sequence of layers. Unlike `keras.Sequential`,
15+ this implementation allows for more flexibility in handling layer arguments
16+ and supports custom serialization through the `@serializable` decorator.
17+
18+ Parameters
19+ ----------
20+ layers : keras.Layer or Sequence[keras.Layer]
21+ A single Keras layer or a sequence of Keras layers to be managed by this model.
22+ **kwargs : dict
23+ Additional keyword arguments passed to the base `keras.Layer` class.
24+
25+ Notes
26+ -----
27+ - This class differs from `keras.Sequential` in that it does not assume a strict
28+ linear stack of layers and provides custom methods for serialization and
29+ configuration.
30+ - It is designed to integrate with the BayesFlow framework and supports
31+ additional utilities like `layer_kwargs`.
32+ """
1033 def __init__ (self , * layers : keras .Layer | Sequence [keras .Layer ], ** kwargs ):
1134 super ().__init__ (** layer_kwargs (kwargs ))
1235 if len (layers ) == 1 and isinstance (layers [0 ], Sequence ):
You can’t perform that action at this time.
0 commit comments