From 02c74c5235b8ad821786213a3bcf5f824162454d Mon Sep 17 00:00:00 2001 From: Melissa Tan Date: Wed, 9 Mar 2022 12:29:18 +0100 Subject: [PATCH] Include activations in Sequential example. --- flax/linen/combinators.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/flax/linen/combinators.py b/flax/linen/combinators.py index 84e265ef81..0fb8f340da 100644 --- a/flax/linen/combinators.py +++ b/flax/linen/combinators.py @@ -19,13 +19,14 @@ class Sequential(Module): Example usage:: class Foo(nn.Module): - feature_sizes: Sequence[int] - - @nn.compact - def __call__(self, x): - return nn.Sequential([nn.Dense(layer_size, name=f'layers_{idx}') - for idx, layer_size - in enumerate(self.feature_sizes)])(x) + feature_sizes: Sequence[int] + + @nn.compact + def __call__(self, x): + return nn.Sequential([nn.Dense(4), + nn.relu, + nn.Dense(2), + nn.log_softmax])(x) """ layers: Sequence[Callable]