tensorflow / swift-models

Models and examples built with Swift for TensorFlow
Apache License 2.0
644 stars 145 forks source link

Update autoencoder #289

Open rickwierenga opened 4 years ago

rickwierenga commented 4 years ago

Hi,

May I update the auto encoder model with the following models: https://github.com/rickwierenga/notebooks/blob/master/autoencoders.ipynb (in Swift, of course) ? The proposed models are more extensive and I think they have better results than the current implementation.

Let me know what you think.

BradLarson commented 4 years ago

I'm not attached to the current dense model, I just like how simple it is for demonstrating the core concepts and acting as a quick test. If you want to replace it with their dense model, which should be just as simple but performs better that sounds reasonable.

I don't want to make the model overly complex, because I still want it to be a good quick demonstration, but if you have a clean way to show off the other two variants, that could also work. We also could start grouping the generative model examples together to simplify some of the project structure.

Project-wise, we don't necessarily need to have every variant of every model implemented here, and I like to focus on areas where we don't have coverage. What operations aren't we using in models, and what models can demonstrate and exercise them? What classes of models are we missing?

rickwierenga commented 4 years ago

That sounds perfectly reasonable. I think a convolutional auto encoder would showcase transposed convolutional layers a little more, together with DCGAN. An auto encoder with drop out (or any other way of applying noise to the input) would not add much value here.


I think it would be a great idea to split this repo into two (well, actually three with datasets) main parts:

  1. Notebook examples. People will probably be using notebooks when developing when developing models so it would only be "natural" (logical) to present the models this way. It's all in all a better way to present code, in my opinion.
  2. Pretrained models for transfer learning. I know @BradLarson is working on this. This repository would probably be the best way to host them, as here: https://github.com/tensorflow/swift-models/tree/master/Models/ImageClassification.

We could group notebooks together in folders, as you propose, Brad. Let me know if you are interested in this. I'm willing to copy the code over if you like.


On projects we are missing, I think an image segmentation model would be a nice addition. During GCI I implemented Tiramisu in Python. Shall I try to port it to Swift? I'm not sure how skip connections would work in Swift, but we should be able to figure that out. Moreover, would it be possible to share the DenseNet blocks?

~I would also like to try to implement DenseNet 169 and 201. Can I do that?~ Just saw @Shashi456 is doing that here.