bert VS Swin-Transformer

Compare bert vs Swin-Transformer and see what are their differences.

Swin-Transformer

This is an official implementation for "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows". (by microsoft)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
bert Swin-Transformer
49 23
36,945 12,879
1.2% 3.0%
0.0 3.1
11 days ago 7 days ago
Python Python
Apache License 2.0 MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

bert

Posts with mentions or reviews of bert. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-12-10.
  • OpenAI – Application for US trademark "GPT" has failed
    1 project | news.ycombinator.com | 15 Feb 2024
    task-specific parameters, and is trained on the downstream tasks by simply fine-tuning all pre-trained parameters.

    [0] https://arxiv.org/abs/1810.04805

  • Integrate LLM Frameworks
    5 projects | dev.to | 10 Dec 2023
    The release of BERT in 2018 kicked off the language model revolution. The Transformers architecture succeeded RNNs and LSTMs to become the architecture of choice. Unbelievable progress was made in a number of areas: summarization, translation, text classification, entity classification and more. 2023 tooks things to another level with the rise of large language models (LLMs). Models with billions of parameters showed an amazing ability to generate coherent dialogue.
  • Embeddings: What they are and why they matter
    9 projects | news.ycombinator.com | 24 Oct 2023
    The general idea is that you have a particular task & dataset, and you optimize these vectors to maximize that task. So the properties of these vectors - what information is retained and what is left out during the 'compression' - are effectively determined by that task.

    In general, the core task for the various "LLM tools" involves prediction of a hidden word, trained on very large quantities of real text - thus also mirroring whatever structure (linguistic, syntactic, semantic, factual, social bias, etc) exists there.

    If you want to see how the sausage is made and look at the actual algorithms, then the key two approaches to read up on would probably be Mikolov's word2vec (https://arxiv.org/abs/1301.3781) with the CBOW (Continuous Bag of Words) and Continuous Skip-Gram Model, which are based on relatively simple math optimization, and then on the BERT (https://arxiv.org/abs/1810.04805) structure which does a conceptually similar thing but with a large neural network that can learn more from the same data. For both of them, you can either read the original papers or look up blog posts or videos that explain them, different people have different preferences on how readable academic papers are.

  • Ernie, China's ChatGPT, Cracks Under Pressure
    1 project | news.ycombinator.com | 7 Sep 2023
  • Ask HN: How to Break into AI Engineering
    2 projects | news.ycombinator.com | 22 Jun 2023
    Could you post a link to "the BERT paper"? I've read some, but would be interested reading anything that anyone considered definitive :) Is it this one? "BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding" :https://arxiv.org/abs/1810.04805
  • How to leverage the state-of-the-art NLP models in Rust
    3 projects | /r/infinilabs | 7 Jun 2023
    Rust crate rust_bert implementation of the BERT language model (https://arxiv.org/abs/1810.04805 Devlin, Chang, Lee, Toutanova, 2018). The base model is implemented in the bert_model::BertModel struct. Several language model heads have also been implemented, including:
  • Notes on training BERT from scratch on an 8GB consumer GPU
    1 project | news.ycombinator.com | 2 Jun 2023
    The achievement of training a BERT model to 90% of the GLUE score on a single GPU in ~100 hours is indeed impressive. As for the original BERT pretraining run, the paper [1] mentions that the pretraining took 4 days on 16 TPU chips for the BERT-Base model and 4 days on 64 TPU chips for the BERT-Large model.

    Regarding the translation of these techniques to the pretraining phase for a GPT model, it is possible that some of the optimizations and techniques used for BERT could be applied to GPT as well. However, the specific architecture and training objectives of GPT might require different approaches or additional optimizations.

    As for the SOPHIA optimizer, it is designed to improve the training of deep learning models by adaptively adjusting the learning rate and momentum. According to the paper [2], SOPHIA has shown promising results in various deep learning tasks. It is possible that the SOPHIA optimizer could help improve the training of BERT and GPT models, but further research and experimentation would be needed to confirm its effectiveness in these specific cases.

    [1] https://arxiv.org/abs/1810.04805

  • List of AI-Models
    14 projects | /r/GPT_do_dah | 16 May 2023
    Click to Learn more...
  • Bert: Pre-Training of Deep Bidirectional Transformers for Language Understanding
    1 project | news.ycombinator.com | 18 Apr 2023
  • Google internally developed chatbots like ChatGPT years ago
    1 project | news.ycombinator.com | 8 Mar 2023

Swin-Transformer

Posts with mentions or reviews of Swin-Transformer. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-10-10.
  • Samsung expected to report 80% profit plunge as losses mount at chip business
    3 projects | news.ycombinator.com | 10 Oct 2023
    > there is really nothing that "normal" AI requires that is bound to CUDA. pyTorch and Tensorflow are backend agnostic (ideally...).

    There are a lot of optimizations that CUDA has that are nowhere near supported in other software or even hardware. Custom cuda kernels also aren't as rare as one might think, they will often just be hidden unless you're looking at libraries. Our more well known example is going to be StyleGAN[0] but it isn't uncommon to see elsewhere, even in research code. Swin even has a cuda kernel[1]. Or find torch here[1] (which github reports that 4% of the code is cuda (and 42% C++ and 2% C)). These things are everywhere. I don't think pytorch and tensorflow could ever be agnostic, there will always be a difference just because you have to spend resources differently (developing kernels is time resource). We can draw evidence by looking at Intel MKL, which is still better than open source libraries and has been so for a long time.

    I really do want AMD to compete in this space. I'd even love a third player like Intel. We really do need competition here, but it would be naive to think that there's going to be a quick catchup here. AMD has a lot of work to do and posting a few bounties and starting a company (idk, called "micro grad"?) isn't going to solve the problem anytime soon.

    And fwiw, I'm willing to bet that most AI companies would rather run in house servers than from cloud service providers. The truth is that right now just publishing is extremely correlated to compute infrastructure (doesn't need to be but with all the noise we've just said "fuck the poor" because rejecting is easy) and anyone building products has costly infrastructure.

    [0] https://github.com/NVlabs/stylegan2-ada-pytorch/blob/d72cc7d...

    [1] https://github.com/microsoft/Swin-Transformer/blob/2cb103f2d...

    [2] https://github.com/pytorch/pytorch/tree/main/aten/src

  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
    1 project | /r/neuralnetworks | 9 Apr 2023
    1 project | /r/u_hjj194 | 20 Sep 2022
  • Swin Transformer: Hierarchical Vision Transformer Using Shifted Windows
    1 project | /r/hypeurls | 9 Apr 2023
    2 projects | news.ycombinator.com | 9 Apr 2023
  • [D] Influential papers round-up 2022. What are your favorites?
    5 projects | /r/MachineLearning | 3 Jan 2023
    ConvNeXt. The A ConvNet for the 2020s paper is a highlight for me because the authors were able to design a purely convolutional architecture that outperformed popular vision transformers such as Swin Transformer (and all convolutional neural networks that came before it, of course).
  • [R] LiBai: a large-scale open-source model training toolbox
    4 projects | /r/MachineLearning | 9 Nov 2022
    Found relevant code at https://github.com/microsoft/Swin-Transformer + all code implementations here
  • Using VIT as a feature extractor
    1 project | /r/computervision | 25 Oct 2022
    Figures aside, you can reform the image from the tokens if you want. This is what's done in SWIN transformers (https://arxiv.org/abs/2103.14030) patches are tokenized, transformed, and then re-assembled into an image-like tensor. The patchification is shifted at every other transformer stage so that there is more information that propagates from one patch to the next.
  • Pathways Autoregressive Text-to-Image Model (Parti)
    2 projects | news.ycombinator.com | 22 Jun 2022
    Give it a few days and lucidrains will have the code up[0].

    But in honesty, it is probably how people react. We saw this with Pulse, GPT, and many others. The authors are clear about the limitations but people talk it up too much and others shit on it. There's also a reproducibility crisis in ML (many famous networks, like Swin[1][2][3], can't be reproduced (even worse when reviewers concentrate on benchmarks)). It isn't like many can train a model like this anyways. It gives them benefit of the doubt and maintains good publicity rather than controversial.

    Of course, this is extremely bad from an academic perspective and personally I believe you should have your paper revoked if it isn't reproducible. You'd be surprised how many don't track the random seed or measure variance. We have GitHub. You should be able to write training options that get approximately the same results as the paper. Otherwise I don't trust your results.

    [0] https://github.com/lucidrains/parti-pytorch

    [1] https://github.com/microsoft/Swin-Transformer/issues/183

    [2] https://github.com/microsoft/Swin-Transformer/issues/180

    [3] https://github.com/microsoft/Swin-Transformer/issues/148

  • [D] What do you value in a paper replication?
    2 projects | /r/MachineLearning | 30 May 2022
    That's about it. I should be able to go to your code and hit run, and reproduce your results (or within the reported variance). If you don't meet any of these criteria them I'm going to be pretty upset and lose a lot of respect for your work. I think we should also put pressure on these papers if they don't meet these conditions, especially if they are pushing the benchmarks (I'm looking at you Swin). If you win on benchmarks due to silicon lottery, then we shouldn't be trusting you.

What are some alternatives?

When comparing bert and Swin-Transformer you can also consider the following projects:

NLTK - NLTK Source

Swin-Transformer-Tensorflow - Unofficial implementation of "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows" (https://arxiv.org/abs/2103.14030)

bert-sklearn - a sklearn wrapper for Google's BERT model

parti-pytorch - Implementation of Parti, Google's pure attention-based text-to-image neural network, in Pytorch

pysimilar - A python library for computing the similarity between two strings (text) based on cosine similarity

Video-Swin-Transformer - This is an official implementation for "Video Swin Transformers".

transformers - 🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.

pytorch-image-models - PyTorch image models, scripts, pretrained weights -- ResNet, ResNeXT, EfficientNet, NFNet, Vision Transformer (ViT), MobileNet-V3/V2, RegNet, DPN, CSPNet, Swin Transformer, MaxViT, CoAtNet, ConvNeXt, and more

PURE - [NAACL 2021] A Frustratingly Easy Approach for Entity and Relation Extraction https://arxiv.org/abs/2010.12812

ConvNeXt - Code release for ConvNeXt model

NL_Parser_using_Spacy - NLP parser using NER and TDD

semantic-segmentation-pytorch - Pytorch implementation for Semantic Segmentation/Scene Parsing on MIT ADE20K dataset