Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New examples requested #1131

Open
2 of 12 tasks
msaroufim opened this issue Apr 10, 2023 · 47 comments
Open
2 of 12 tasks

New examples requested #1131

msaroufim opened this issue Apr 10, 2023 · 47 comments

Comments

@msaroufim
Copy link
Member

msaroufim commented Apr 10, 2023

Hi everyone, @svekars and I are looking to increase the number of new contributions to pytorch/examples, this might be especially interesting to you if you've never contributed to an open source project before.

At a high level, we're looking for new interesting models.

So here's what you need to do

  1. Check out our contributing guide: https://github.com/pytorch/examples/blob/main/CONTRIBUTING.md
  2. Pick a model idea - I've listed a few below, comment on this task so others know you're working on it
  3. Implement your model from scratch using PyTorch, no external dependencies will be allowed to keep the examples as educational as possible

Your implementation needs to include

  1. A folder with your code which needs to define
  2. Your model architecture
  3. Training code
  4. Evaluation code
  5. An argparser
  6. Make sure your script runs in CI so it doesn't break in the future by adding it to run_python_examples.sh
  7. README describing any usage instructions

As an example this recent contribution by @sudomaze is a good one to follow https://github.com/pytorch/examples/pull/1003/files

Here are some model ideas

Model ideas

  • Controlnet - Guided diffusion
  • NERF
  • Graph Neural Network @JoseLuisC99
  • Diffusion Model, stable diffusion or any variant of the architecture you like
  • Vision Transformer
  • Video model
  • Toolformer
  • Differentiable physics
  • Flownet
  • Dreamfusion or any 3d model
  • Language Translation
  • Swin transformer

But I'm quite open to anything we don't have that's cool

@niyarrbarman
Copy link
Contributor

Hey! I'm interested in contributing to the vision transformer model, but I don't have any prior open source contribution experience. Would it be okay for me to proceed with this project?

@msaroufim
Copy link
Member Author

Yes please go for it

@2357juan
Copy link

I am interested as well. What is a video model? I am looking at some video examples from tensorflow and keras. Would a spinoff of this suffice? That dataset looks like a standard intro video dataset.

Which of these problems can be comfortably exercised on a 2080ti(12gb vram)?

@xorsuyash
Copy link

@msaroufim I would Like to contribute to examples related to graph neural networks ,Is there any specific Dataset i should choose for this or i can choose any dataset of my own choice for examples .

@msaroufim
Copy link
Member Author

Yes to all of the above

@aditikhare007
Copy link

@msaroufim I am interested for PyTorch Open-Source Contribution. Thank you for sharing New examples requested Note, would like to contribute to Diffusion Model, stable diffusion and Vision Transformer sections will keep you posted as my work progress.
Please let me know your thoughts on taking up this project. Thank you.
Regards,
Aditi

@Krish2002
Copy link

hey! I would love to contribute to Stable diffusion. Can i take this up ?

@msaroufim
Copy link
Member Author

Hi @Krish2002 yes please go for it

@IMvision12
Copy link

I would love to contribute to FlowNet. Can I take this up?

@msaroufim
Copy link
Member Author

Hi @IMvision12 please do!

@abhi-glitchhg
Copy link

abhi-glitchhg commented Jun 1, 2023

I would like to add a video vision transformer model.

Edit: Video ViTs are already present in Torchvision, can i still go ahead with this idea? thanks

@msaroufim
Copy link
Member Author

@abhi-glitchhg please do just keep in mind the implementation has to be from scratch and not just call the torcvision constructor

@JoseLuisC99
Copy link
Contributor

I would like to contribute to Graph Neural Network. However, is there some specific task or model in mind or can I choose any?

@HemanthSai7
Copy link

Hi @msaroufim I would like to implement language translation using encoder-decoder architecture. Can I take this?

@msaroufim
Copy link
Member Author

@JoseLuisC99 any task or model you like! As long as it's from scratch in pure Pytorch

@guptaaryan16
Copy link

Hey @msaroufim I would like to work on stable diffusion and some others topics as well. Thanks

@msaroufim
Copy link
Member Author

@guptaaryan16 @HemanthSai7 @JoseLuisC99 @abhi-glitchhg assigned some models to you, lemme know if you need any help to get it over the finish line. Thanks!

@arunppsg
Copy link

arunppsg commented Jun 2, 2023

Can I take up implementing Controlnet - guided diffusion?

Apologies, I could not complete it. If someone else is interested, feel free to take it up - I am no longer working on it.

@HemanthSai7
Copy link

@msaroufim can I use the transformers library to use the tokenizers?

@bhavyashahh
Copy link

@msaroufim can I take up NERF?

@QasimKhan5x
Copy link

@msaroufim I'd like to implement a text to 3d model. At the moment, I'm deciding between Test2Mesh and CLIP-Forge. DreamFusion seems a little complex.

@msaroufim
Copy link
Member Author

@HemanthSai7 yes but the model should be pure PyTorch, bonus point for a from scratch tokenizer!
@bhavyashahh Sure!
@QasimKhan5x Sounds good, either of those models work

@svekars
Copy link
Contributor

svekars commented Jun 2, 2023

Please reference this issue in your PRs, like "Re #1131".

@IMvision12
Copy link

@msaroufim Sorry, but owing to university examinations I will not be able to participate this time. However, if anybody wants to take FlowNet, they are welcome to do so. :)

@HemanthSai7
Copy link

Wanted to give updates on my task. I have completed preparing the dataset(tokenization, data-loading, etc) for the translation task and will start with Positional Embeddings and other layers.

@yishengpei
Copy link

Hey! I am wondering whether the Vision Transformer model is taken or not. I am willing to contribute. Or otherwise, would you be interested if I work on the Swin Transformer model? Many thanks.

@msaroufim
Copy link
Member Author

Thanks @HemanthSai7

@yishengpei vision transformer was completed already but would be happy to review swin transformer

@HemanthSai7
Copy link

HemanthSai7 commented Jun 11, 2023

I'm seeing a lot of nan values when I print the attn_output_weights in nn.MultiheadAttention in the decoder block. Is it expected or is it due to a fault in the logic?

@HemanthSai7
Copy link

def generate_square_subsequent_mask(seq_len):
  mask = (torch.triu(torch.ones(seq_len, seq_len)) == 1).transpose(0, 1)
  mask = mask.float().masked_fill(mask == 0, float('-inf')).masked_fill(mask== 1, float(0.0))
  return mask

I'm unable to understand this way of generating masks used in the source code.

@msaroufim
Copy link
Member Author

I'm seeing a lot of nan values when I print the attn_output_weights in nn.MultiheadAttention in the decoder block. Is it expected or is it due to a fault in the logic?

Could you please share a repro? That's certainly not expected

@msaroufim
Copy link
Member Author

def generate_square_subsequent_mask(seq_len):
  mask = (torch.triu(torch.ones(seq_len, seq_len)) == 1).transpose(0, 1)
  mask = mask.float().masked_fill(mask == 0, float('-inf')).masked_fill(mask== 1, float(0.0))
  return mask

I'm unable to understand this way of generating masks used in the source code.

What exactly is confusing you?

Running it prints a reasonable looking mask to me

generate_square_subsequent_mask(10)
tensor([[0., -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf],
        [0., 0., -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf],
        [0., 0., 0., -inf, -inf, -inf, -inf, -inf, -inf, -inf],
        [0., 0., 0., 0., -inf, -inf, -inf, -inf, -inf, -inf],
        [0., 0., 0., 0., 0., -inf, -inf, -inf, -inf, -inf],
        [0., 0., 0., 0., 0., 0., -inf, -inf, -inf, -inf],
        [0., 0., 0., 0., 0., 0., 0., -inf, -inf, -inf],
        [0., 0., 0., 0., 0., 0., 0., 0., -inf, -inf],
        [0., 0., 0., 0., 0., 0., 0., 0., 0., -inf],
        [0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]])

@HemanthSai7
Copy link

@msaroufim I was trying to create my own mask rule. Found out where I went wrong and fixed it.

@MBora
Copy link

MBora commented Jun 26, 2023

@msaroufim I would like to contribute to the OpenAI whisper implementation. Can I take this up?

@msaroufim
Copy link
Member Author

Sure yeah! That sound cool

@MBora
Copy link

MBora commented Jul 1, 2023

What is the expected outcome in this context? The model and its pretrained weights can be obtained from OpenAI's Whisper repository. One possible approach is to utilize the model class and showcase the process of training or fine-tuning, as the original repository does not include training functionality.

@ebrahimpichka
Copy link
Contributor

Hi, I see the GNN example is taken care of as a GCN example. Would other GNN variants such as GAT, GraphSage, etc. be helpful, or would they be counted as kinda duplicates?

@msaroufim
Copy link
Member Author

@ebrahimpichka id love to see variants.

@ebrahimpichka
Copy link
Contributor

@msaroufim great, I'd like to work on it.

@mingxzhao
Copy link

@msaroufim if no one is working on Flownet, can I be assigned?

@msaroufim
Copy link
Member Author

@mingxzhao it's yours

@JoseLuisC99
Copy link
Contributor

JoseLuisC99 commented Sep 18, 2023

@msaroufim When you say "Differentiable physics", do you mean Physic-informed deep learning? Or do you have some other architecture in mind?

@msaroufim
Copy link
Member Author

Yeah that's what I had in mind but open to other cool sounding models

@JoseLuisC99
Copy link
Contributor

Cool! I think that I can try PINNs and another modern solution using graph nets, so please assign me this problem.

@kausthub-kannan
Copy link

kausthub-kannan commented Oct 7, 2023

Hello, I am new to contributing to PyTorch, @msaroufim Can I try contributing a new example "UNet Image Segmenation"?

Thank You

@msaroufim
Copy link
Member Author

Hi folks yeah please go for it, no need to ask me for permission just send a PR and tag me so I can review

@sarthak247
Copy link

Greetings,
I just came across this and would also like to be a part of it. As of now, I can only see that toolformer is the only model that is not taken up or assigned to anyone. Is it fine if I work on this? And also, is yes, I would need some assistance as to where to start from on this.
Regards,
Sarthak <3

@NoahSchiro
Copy link
Contributor

Hey @HemanthSai7 and @msaroufim I've just submitted a PR for the language translation example. Sorry if I duplicated any work you've been working on but I have not heard movement on the language translation example for 6 months so I thought it would be safe to work on it.

msaroufim added a commit that referenced this issue Apr 2, 2024
* Intial model setup

* Training works

* Added inference

* Code clean up and commenting

* Update to README.md

* Add requirements.txt

* Updated top level README, added example to CI

* Potentially fixed testing (maybe not enough memory?)

* Update requirements.txt

---------

Co-authored-by: Mark Saroufim <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests