Skip to content

Commit

Permalink
Include activations in Sequential example.
Browse files Browse the repository at this point in the history
  • Loading branch information
melissatan committed Mar 9, 2022
1 parent e1d4e45 commit 02c74c5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions flax/linen/combinators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 02c74c5

Please sign in to comment.