You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.
Add a SequentialComposition<Base> layer wrapper type.
SequentialComposition is a Layer that wraps a collection, applying each element in sequence to an input to produce an output. The callAsFunction method calls differentiableReduce, with the input as the initial value.
This allows collections of Layers like [Dense<Float>] to be treated as a Layer.
An alternative idea is to directly conform Array to Layer: #708.
But this hardcodes a particular Array: Layer conformance, when there may be multiple ways to interpret an Array as a Layer. A generic "SequentialComposition<Base>" layer wrapper type is more flexible and explicit about the Layer behavior.
Add a
SequentialComposition<Base>
layer wrapper type.SequentialComposition
is aLayer
that wraps a collection, applying each element in sequence to an input to produce an output. ThecallAsFunction
method callsdifferentiableReduce
, with the input as the initial value.This allows collections of
Layer
s like[Dense<Float>]
to be treated as aLayer
.Original idea and work by @dabrahams.
Work-in-progress implementation: currently blocked by
Collection.differentiableReduce(_:_:)
.An alternative idea is to directly conform
Array
toLayer
: #708.But this hardcodes a particular
Array: Layer
conformance, when there may be multiple ways to interpret anArray
as aLayer
. A generic "SequentialComposition<Base>
" layer wrapper type is more flexible and explicit about theLayer
behavior.Full rationale by @dabrahams.
The text was updated successfully, but these errors were encountered: