tensorflow / swift-apis

Swift for TensorFlow Deep Learning Library
Apache License 2.0
795 stars 135 forks source link

Support Advanced Layers #685

Open Shashi456 opened 4 years ago

Shashi456 commented 4 years ago

Now that we support a multitude of basic layers, I'd like this issue to serve as the discussion for supporting advanced layers. While #54 tracked basic layers and most have been implemented, We now need to consider which of the following to add in swift-apis. tensorflow/swift-models#231 added bert, with that also added support for transformers and attention layers. Having reviewed a variety of current frameworks, I've made the following list:

If anyone else has any feature/layer requests please do add to this PR.

8bitmp3 commented 4 years ago

There’re Attention and MultiHeadAttention defined in tensorflow/swift-models/Transformer. Maybe those can graduate into ‘/swift-apis’ in some shape and form.

(see struct Attention: ParameterlessLayer..., for example)

Shashi456 commented 4 years ago

@8bitmp3 yeah that's the plan for the transformer and attention layers afaik, we stage the layers there while eventually moving the fleshed out versions to this repository.

brettkoonce commented 4 years ago

could use a UpSampling2D to do an autoencoder demo.

Shashi456 commented 4 years ago

@brettkoonce Upsampling1D, 2D and 3D already exist.

brettkoonce commented 4 years ago

@Shashi456 not sure how i missed that 😓

Shashi456 commented 4 years ago

@dan-zheng could you add a good first issue tag to this PR? And add any other comments if you have any.

gsnsg commented 4 years ago

@Shashi456 Is this list updated? If so I would like to contribute

xanderdunn commented 3 years ago

swift-models/Models/Text/GPT2/TransformerLM.swift has a TimeDistributed Layer. I believe this is a specific case of the Tensorflow keras TimeDistributed, which takes an arbitrary layer and applies it across the temporal dimension. In the swift-models case it is wrapping specifically a given Dense<Float> layer.