Stop studying LLM from random articles and videos that only explain individual pieces of the puzzle.
π LLM from Scratch β this is a practical course on PyTorch for those who want to understand the entire path of modern LLMs: from the first Transformer block to RLHF.
Instead of endless theory, here we gather a complete model training chain:
πΉ Pretraining β Finetuning β Alignment in one course
πΉ Transformer from scratch: positional embeddings, self-attention, multi-head attention, MLP, residual connections, LayerNorm, and full Transformer blocks
πΉ Own training loop without Trainer magic: tokenization, batches, cross-entropy, validation loss, text generation
πΉ Modern architecture improvements: RMSNorm, RoPE, SwiGLU, KV Cache, sliding-window attention, and streaming cache
πΉ Full section on alignment: SFT, reward models, PPO-style RLHF, and GRPO with an analysis of how it looks in the training loop in practice
https://github.com/vivekkalyanarangan30/llm_from_scratch
#LLM #PyTorch #MachineLearning #DeepLearning #AI #Transformer
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
π Level up your AI & Data Science skills with HelloEncyclo β a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
β 13 courses live + 40+ coming soon
π― One access, lifetime updates
π Use code: PRESALE-BOOK-WAVE-2GFG
π https://helloencyclo.com/?ref=HUSSEINSHEIKHO
π LLM from Scratch β this is a practical course on PyTorch for those who want to understand the entire path of modern LLMs: from the first Transformer block to RLHF.
Instead of endless theory, here we gather a complete model training chain:
πΉ Pretraining β Finetuning β Alignment in one course
πΉ Transformer from scratch: positional embeddings, self-attention, multi-head attention, MLP, residual connections, LayerNorm, and full Transformer blocks
πΉ Own training loop without Trainer magic: tokenization, batches, cross-entropy, validation loss, text generation
πΉ Modern architecture improvements: RMSNorm, RoPE, SwiGLU, KV Cache, sliding-window attention, and streaming cache
πΉ Full section on alignment: SFT, reward models, PPO-style RLHF, and GRPO with an analysis of how it looks in the training loop in practice
https://github.com/vivekkalyanarangan30/llm_from_scratch
#LLM #PyTorch #MachineLearning #DeepLearning #AI #Transformer
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
π Level up your AI & Data Science skills with HelloEncyclo β a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
β 13 courses live + 40+ coming soon
π― One access, lifetime updates
π Use code: PRESALE-BOOK-WAVE-2GFG
π https://helloencyclo.com/?ref=HUSSEINSHEIKHO
β€2
Google has published a free guide on scaling AI models and working with GPUs. π
π How to Scale Your Model
https://jax-ml.github.io/scaling-book/
π How to Think About GPUs
https://jax-ml.github.io/scaling-book/gpus/
The materials discuss the principles of model scaling, the structure of GPUs, computational limitations, memory bandwidth, parallelism, and other topics that are useful when training and running modern AI models. π‘
It's completely free and available online. π
#AI #MachineLearning #GPU #Scaling #DeepLearning #Tech
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
π Level up your AI & Data Science skills with HelloEncyclo β a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
β 13 courses live + 40+ coming soon
π― One access, lifetime updates
π Use code: PRESALE-BOOK-WAVE-2GFG
π https://helloencyclo.com/?ref=HUSSEINSHEIKHO
π How to Scale Your Model
https://jax-ml.github.io/scaling-book/
π How to Think About GPUs
https://jax-ml.github.io/scaling-book/gpus/
The materials discuss the principles of model scaling, the structure of GPUs, computational limitations, memory bandwidth, parallelism, and other topics that are useful when training and running modern AI models. π‘
It's completely free and available online. π
#AI #MachineLearning #GPU #Scaling #DeepLearning #Tech
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
π Level up your AI & Data Science skills with HelloEncyclo β a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
β 13 courses live + 40+ coming soon
π― One access, lifetime updates
π Use code: PRESALE-BOOK-WAVE-2GFG
π https://helloencyclo.com/?ref=HUSSEINSHEIKHO
How To Scale Your Model
Training LLMs often feels like alchemy, but understanding and optimizing the performance of your models doesn't have to. This book aims to demystify the science of scaling language models: how TPUs (and GPUs) work and how they communicate with each otherβ¦
β€1
A large collection of materials on LLM Systems,
β’ model training (pre-training, RLHF, fault tolerance, stragglers)
β’ inference and serving
β’ agent systems
β’ edge deployment
β’ multimodal models
β’ technical reports from major laboratories
β’ reviews, benchmarks, and leaderboards
β’ courses on MLSys and collections of articles from conferences
https://github.com/AmberLJC/LLMSys-PaperList
#LLMSys #LLM #MachineLearning #AIResearch #DeepLearning #TechReports
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
π Level up your AI & Data Science skills with HelloEncyclo β a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
β 13 courses live + 40+ coming soon
π― One access, lifetime updates
π Use code: PRESALE-BOOK-WAVE-2GFG
π https://helloencyclo.com/?ref=HUSSEINSHEIKHO
β’ model training (pre-training, RLHF, fault tolerance, stragglers)
β’ inference and serving
β’ agent systems
β’ edge deployment
β’ multimodal models
β’ technical reports from major laboratories
β’ reviews, benchmarks, and leaderboards
β’ courses on MLSys and collections of articles from conferences
https://github.com/AmberLJC/LLMSys-PaperList
#LLMSys #LLM #MachineLearning #AIResearch #DeepLearning #TechReports
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
π Level up your AI & Data Science skills with HelloEncyclo β a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
β 13 courses live + 40+ coming soon
π― One access, lifetime updates
π Use code: PRESALE-BOOK-WAVE-2GFG
π https://helloencyclo.com/?ref=HUSSEINSHEIKHO
GitHub
GitHub - AmberLJC/LLMSys-PaperList: Large Language Model (LLM) Systems Paper List
Large Language Model (LLM) Systems Paper List. Contribute to AmberLJC/LLMSys-PaperList development by creating an account on GitHub.
β€1
Forwarded from Machine Learning with Python
10 GitHub repositories that are worth checking out for an AI engineer π€
1. Hands-On AI Engineering π οΈ
A collection of AI applications and agent systems with practical use cases of LLM.
π https://github.com/Sumanth077/Hands-On-AI-Engineering
2. Hands-On Large Language Models π
Full code from the book Hands-On Large Language Models: from basics to fine-tuning.
π https://github.com/HandsOnLLM/Hands-On-Large-Language-Models
3. AI Agents for Beginners π
A free course from Microsoft with 11 lessons on creating AI agents.
π https://github.com/microsoft/ai-agents-for-beginners
4. GenAI Agents π€
A large collection of tutorials and implementations of agent systems.
π https://github.com/NirDiamant/GenAI_Agents
5. Made With ML π
About the development, deployment, and support of production-ready ML systems.
π https://github.com/GokuMohandas/Made-With-ML
6. Learn Harness Engineering βοΈ
A practical course on Harness Engineering for AI agents.
π https://github.com/walkinglabs/learn-harness-engineering
7. AutoResearch π¬
Autonomous cycles of ML experiments from Andrej Karpathy.
π https://github.com/karpathy/autoresearch
8. Designing Machine Learning Systems π
Notes and materials from Chip Huyen's book.
π https://github.com/chiphuyen/dmls-book
9. Awesome LLM Inference β‘
A collection of materials on LLM inference: Flash Attention, KV Cache, quantization, and more.
π https://github.com/xlite-dev/Awesome-LLM-Inference
10. LLM Course πΊοΈ
A practical course on LLM with a roadmap and Colab notebooks.
π https://github.com/mlabonne/llm-course
#AI #MachineLearning #LLM #DataScience #Tech #GitHub
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
π Level up your AI & Data Science skills with HelloEncyclo β a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
β 13 courses live + 40+ coming soon
π― One access, lifetime updates
π Use code: PRESALE-BOOK-WAVE-2GFG
π https://helloencyclo.com/?ref=HUSSEINSHEIKHO
1. Hands-On AI Engineering π οΈ
A collection of AI applications and agent systems with practical use cases of LLM.
π https://github.com/Sumanth077/Hands-On-AI-Engineering
2. Hands-On Large Language Models π
Full code from the book Hands-On Large Language Models: from basics to fine-tuning.
π https://github.com/HandsOnLLM/Hands-On-Large-Language-Models
3. AI Agents for Beginners π
A free course from Microsoft with 11 lessons on creating AI agents.
π https://github.com/microsoft/ai-agents-for-beginners
4. GenAI Agents π€
A large collection of tutorials and implementations of agent systems.
π https://github.com/NirDiamant/GenAI_Agents
5. Made With ML π
About the development, deployment, and support of production-ready ML systems.
π https://github.com/GokuMohandas/Made-With-ML
6. Learn Harness Engineering βοΈ
A practical course on Harness Engineering for AI agents.
π https://github.com/walkinglabs/learn-harness-engineering
7. AutoResearch π¬
Autonomous cycles of ML experiments from Andrej Karpathy.
π https://github.com/karpathy/autoresearch
8. Designing Machine Learning Systems π
Notes and materials from Chip Huyen's book.
π https://github.com/chiphuyen/dmls-book
9. Awesome LLM Inference β‘
A collection of materials on LLM inference: Flash Attention, KV Cache, quantization, and more.
π https://github.com/xlite-dev/Awesome-LLM-Inference
10. LLM Course πΊοΈ
A practical course on LLM with a roadmap and Colab notebooks.
π https://github.com/mlabonne/llm-course
#AI #MachineLearning #LLM #DataScience #Tech #GitHub
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
π Level up your AI & Data Science skills with HelloEncyclo β a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
β 13 courses live + 40+ coming soon
π― One access, lifetime updates
π Use code: PRESALE-BOOK-WAVE-2GFG
π https://helloencyclo.com/?ref=HUSSEINSHEIKHO
Forwarded from Machine Learning with Python
π A Free AI Course for Beginners by Microsoft
For those just getting into artificial intelligence, Microsoft offers a free course.
It runs for 12 weeks and includes 24 lessons with theory, hands-on assignments, labs, and quizzes.
The curriculum covers neural networks and deep learning, computer vision, natural language processing, genetic algorithms, and AI ethics. For practice, it uses the two main ML frameworksβTensorFlow and PyTorch.
Each lesson follows the same structure: first, reading material, then a Jupyter notebook with code, and for some topics, a lab. The course is in English but has been translated into dozens of languages.
β‘οΈ All materials and links are on GitHub
https://github.com/microsoft/AI-For-Beginners/blob/main/translations/ru/README.md
What's your AI level right now?
β€οΈ β Advanced user
π₯ β Almost zero
#AICourse #Microsoft #DeepLearning #TensorFlow #PyTorch #MachineLearning
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
π Level up your AI & Data Science skills with HelloEncyclo β a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
β 13 courses live + 40+ coming soon
π― One access, lifetime updates
π Use code: PRESALE-BOOK-WAVE-2GFG
π https://helloencyclo.com/?ref=HUSSEINSHEIKHO
For those just getting into artificial intelligence, Microsoft offers a free course.
It runs for 12 weeks and includes 24 lessons with theory, hands-on assignments, labs, and quizzes.
The curriculum covers neural networks and deep learning, computer vision, natural language processing, genetic algorithms, and AI ethics. For practice, it uses the two main ML frameworksβTensorFlow and PyTorch.
Each lesson follows the same structure: first, reading material, then a Jupyter notebook with code, and for some topics, a lab. The course is in English but has been translated into dozens of languages.
β‘οΈ All materials and links are on GitHub
https://github.com/microsoft/AI-For-Beginners/blob/main/translations/ru/README.md
What's your AI level right now?
β€οΈ β Advanced user
π₯ β Almost zero
#AICourse #Microsoft #DeepLearning #TensorFlow #PyTorch #MachineLearning
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
π Level up your AI & Data Science skills with HelloEncyclo β a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
β 13 courses live + 40+ coming soon
π― One access, lifetime updates
π Use code: PRESALE-BOOK-WAVE-2GFG
π https://helloencyclo.com/?ref=HUSSEINSHEIKHO
Forwarded from Machine Learning with Python
Learn AI for free directly from top companies. π
1 - Anthropic:
anthropic.skilljar.com
2 - Google:
grow.google/ai
3 - Meta:
ai.meta.com/resources/
4 - NVIDIA:
developer.nvidia.com/cuda
5 - Microsoft:
learn.microsoft.com/en-us/training/
6 - OpenAI:
academy.openai.com
7 - IBM:
skillsbuild.org
8 - AWS:
skillbuilder.aws
9 - DeepLearning.AI:
deeplearning.ai
10 - Hugging Face:
huggingface.co/learn
π¬ Comment "Learning" if you find this helpful.
π Repost so others can take help.
π Must bookmark for future reference.
#AI #MachineLearning #Tech #FreeLearning #DataScience #AIForAll
https://t.iss.one/CodeProgrammer
1 - Anthropic:
anthropic.skilljar.com
2 - Google:
grow.google/ai
3 - Meta:
ai.meta.com/resources/
4 - NVIDIA:
developer.nvidia.com/cuda
5 - Microsoft:
learn.microsoft.com/en-us/training/
6 - OpenAI:
academy.openai.com
7 - IBM:
skillsbuild.org
8 - AWS:
skillbuilder.aws
9 - DeepLearning.AI:
deeplearning.ai
10 - Hugging Face:
huggingface.co/learn
π¬ Comment "Learning" if you find this helpful.
π Repost so others can take help.
π Must bookmark for future reference.
#AI #MachineLearning #Tech #FreeLearning #DataScience #AIForAll
https://t.iss.one/CodeProgrammer
Grow with Google US
AI Training to Grow Your Career | Google
Learn all about AI & how to supercharge your work or business. We offer AI courses and tools that will help you build essential AI skills.
β€4
This media is not supported in your browser
VIEW IN TELEGRAM
π Building our own GPT-like model in PyTorch
We've found an excellent repository for those who want to understand how modern LLMs are built under the hood.
Inside β 10 Jupyter notebooks with step-by-step explanations and implementations of key components of language models.
GitHub: https://github.com/analyticalrohit/llms-from-scratch
#PyTorch #LLM #MachineLearning #AI #DeepLearning #DataScience
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
π Level up your AI & Data Science skills with HelloEncyclo β a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
β 13 courses live + 40+ coming soon
π― One access, lifetime updates
π Use code: PRESALE-BOOK-WAVE-2GFG
π https://helloencyclo.com/?ref=HUSSEINSHEIKHO
We've found an excellent repository for those who want to understand how modern LLMs are built under the hood.
Inside β 10 Jupyter notebooks with step-by-step explanations and implementations of key components of language models.
GitHub: https://github.com/analyticalrohit/llms-from-scratch
#PyTorch #LLM #MachineLearning #AI #DeepLearning #DataScience
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
π Level up your AI & Data Science skills with HelloEncyclo β a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
β 13 courses live + 40+ coming soon
π― One access, lifetime updates
π Use code: PRESALE-BOOK-WAVE-2GFG
π https://helloencyclo.com/?ref=HUSSEINSHEIKHO
β€3
Curates LLM tools and research for scientific discovery π§¬π¬
Repo: https://github.com/HKUST-KnowComp/Awesome-LLM-Scientific-Discovery ππ
#LLM #ScientificDiscovery #ResearchTools #AI #MachineLearning #DataScience
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
π Level up your AI & Data Science skills with HelloEncyclo β a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
β 13 courses live + 40+ coming soon
π― One access, lifetime updates
π Use code: PRESALE-BOOK-WAVE-2GFG
π https://helloencyclo.com/?ref=HUSSEINSHEIKHO
Repo: https://github.com/HKUST-KnowComp/Awesome-LLM-Scientific-Discovery ππ
#LLM #ScientificDiscovery #ResearchTools #AI #MachineLearning #DataScience
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
π Level up your AI & Data Science skills with HelloEncyclo β a growing all-in-one platform featuring hands-on courses in LLMs, Deep Learning, MLOps, Data Engineering, and more.
β 13 courses live + 40+ coming soon
π― One access, lifetime updates
π Use code: PRESALE-BOOK-WAVE-2GFG
π https://helloencyclo.com/?ref=HUSSEINSHEIKHO
β€1
Forwarded from Machine Learning
This media is not supported in your browser
VIEW IN TELEGRAM
Attention Heatmap vs Token Pruning πβοΈ
π More: https://www.overshoot.ai/blogs/an-introduction-to-token-pruning-for-vlms
#AI #MachineLearning #TokenPruning #DeepLearning #TechNews #VLM
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
π More: https://www.overshoot.ai/blogs/an-introduction-to-token-pruning-for-vlms
#AI #MachineLearning #TokenPruning #DeepLearning #TechNews #VLM
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
β€6
Forwarded from Machine Learning
Media is too big
VIEW IN TELEGRAM
A Collection of Machine Learning Libraries for Python π€
A large repository containing over 900 libraries and frameworks for machine learning. π
All projects are sorted by quality and popularity, which helps you quickly find the best tools for working with AI and ML. βοΈ
Repo: https://github.com/ml-tooling/best-of-ml-python?tab=readme-ov-file#vector-similarity-search-ann
#MachineLearning #Python #AI #DataScience #MLTools #Programming
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
A large repository containing over 900 libraries and frameworks for machine learning. π
All projects are sorted by quality and popularity, which helps you quickly find the best tools for working with AI and ML. βοΈ
Repo: https://github.com/ml-tooling/best-of-ml-python?tab=readme-ov-file#vector-similarity-search-ann
#MachineLearning #Python #AI #DataScience #MLTools #Programming
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
β€5
Exporting the model from PyTorch to the universal ONNX format for independent inference π
Deploying PyTorch models in production often requires installing a large framework and relying on a Python environment. The ONNX (Open Neural Network Exchange) format converts the computation graph into an intermediate binary format suitable for running on any device and programming language. We will export the PyTorch neural network and run its inference using the lightweight ONNX Runtime. π
To export and run the neural network, we will install the PyTorch framework, the ONNX library, and the cross-platform ONNX Runtime engine.
The packages for converting and high-performance execution of graphs have been successfully installed. β
We will write a Python script that creates a test PyTorch model, exports it to a
The model graph has been successfully serialized into a binary file, and the runtime performed the prediction without involving PyTorch. π¦
# verification (checks the correctness and structure of the saved ONNX model)
Expected output: ONNX Model Status: Valid
# cleanup (deletes the generated model file and cleans up binaries)
Converting neural networks to ONNX allows you to decouple inference from Python and run models in C++, Rust, Go, or directly in a web browser. Be sure to specify the names of the input and output tensors when exporting to simplify integration with the service. π»
#PyTorch #ONNX #MachineLearning #DeepLearning #AI #DevOps
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Deploying PyTorch models in production often requires installing a large framework and relying on a Python environment. The ONNX (Open Neural Network Exchange) format converts the computation graph into an intermediate binary format suitable for running on any device and programming language. We will export the PyTorch neural network and run its inference using the lightweight ONNX Runtime. π
To export and run the neural network, we will install the PyTorch framework, the ONNX library, and the cross-platform ONNX Runtime engine.
pip install torch onnx onnxruntime
The packages for converting and high-performance execution of graphs have been successfully installed. β
We will write a Python script that creates a test PyTorch model, exports it to a
.onnx file, and immediately performs a verification of the output.import torch, torch.nn as nn, onnxruntime as ort, numpy as np
model = nn.Sequential(nn.Linear(10, 5), nn.ReLU())
x = torch.randn(1, 10)
torch.onnx.export(model, x, "model.onnx", input_names=["input"], output_names=["output"])
session = ort.InferenceSession("model.onnx")
res = session.run(None, {"input": x.numpy()})
print("ONNX Output shape:", res[0].shape)
The model graph has been successfully serialized into a binary file, and the runtime performed the prediction without involving PyTorch. π¦
# verification (checks the correctness and structure of the saved ONNX model)
python3 -c "import onnx; model = onnx.load('model.onnx'); onnx.checker.check_model(model); print('ONNX Model Status: Valid')"Expected output: ONNX Model Status: Valid
# cleanup (deletes the generated model file and cleans up binaries)
rm -f model.onnx
Converting neural networks to ONNX allows you to decouple inference from Python and run models in C++, Rust, Go, or directly in a web browser. Be sure to specify the names of the input and output tensors when exporting to simplify integration with the service. π»
#PyTorch #ONNX #MachineLearning #DeepLearning #AI #DevOps
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Telegram
AI PYTHON π
Youβve been invited to add the folder βAI PYTHON πβ, which includes 15 chats.
β€1
One of the key moments when I truly understood how transformers work: π§ β¨
"Stop thinking of a transformer as a conveyor belt, where each layer transforms the output of the previous one."
"Start thinking of it as a residual flow." π
Each block in a transformer has a residual connection that adds the input of the block to its output:
Because of this addition, the attention mechanism or MLP within the layer β the function f in the formula above β actually does NOT transform the input. Instead, it calculates the information that needs to be ADDED to the input before passing it to the next block! β
Imagine the main part of the transformer as a shared whiteboard. π Each block reads what it needs from it and adds its own notes. All changes are additions.
Furthermore, layers can exchange information over distances. A block in the first layer can write information, and a block in the fifth layer can read it, even though there is no direct connection between them. π
I owe these ideas to an older article by Anthropic about the architecture of transformers:
transformer-circuits.pub/2021/framework
#Transformers #DeepLearning #AI #MachineLearning #NeuralNetworks #Tech
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
"Stop thinking of a transformer as a conveyor belt, where each layer transforms the output of the previous one."
"Start thinking of it as a residual flow." π
Each block in a transformer has a residual connection that adds the input of the block to its output:
x' = f(x) + x
Because of this addition, the attention mechanism or MLP within the layer β the function f in the formula above β actually does NOT transform the input. Instead, it calculates the information that needs to be ADDED to the input before passing it to the next block! β
Imagine the main part of the transformer as a shared whiteboard. π Each block reads what it needs from it and adds its own notes. All changes are additions.
Furthermore, layers can exchange information over distances. A block in the first layer can write information, and a block in the fifth layer can read it, even though there is no direct connection between them. π
I owe these ideas to an older article by Anthropic about the architecture of transformers:
transformer-circuits.pub/2021/framework
#Transformers #DeepLearning #AI #MachineLearning #NeuralNetworks #Tech
β¨ Join Best TG Channels https://t.iss.one/addlist/0f6vfFbEMdAwODBk
βοΈ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
β€2