Machine Learning
40K subscribers
3.6K photos
28 videos
47 files
622 links
Real Machine Learning β€” simple, practical, and built on experience.
Learn step by step with clear explanations and working code.

Admin: @HusseinSheikho || @Hussein_Sheikho
Download Telegram
πŸŽ“ 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://xn--r1a.website/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
πŸ€– Calculating the Self-Attention mechanism in pure PyTorch.

The Attention Mechanism allows transformer neural networks to determine the connection between words in a text and dynamically focus on the most important context. We will step by step implement the basic algorithm Scaled Dot-Product Attention, using classic matrices of queries (Query), keys (Key) and values (Value). This will help us to visually see how the attention weights are mathematically calculated and how the model matches the tokens with each other. 🧠✨

To start, we will install the PyTorch library for performing tensor calculations. πŸ› οΈ

pip install torch

The library has been successfully loaded and is ready for mathematical modeling of transformer layers. βœ…

We will generate random vectors Query, Key and Value to simulate the passage of tokens through linear projections. 🎲

import torch
import torch.nn.functional as F

q = torch.randn(1, 3, 4) # (batch, seq_len, dim)
k = torch.randn(1, 3, 4)
v = torch.randn(1, 3, 4)

The tensors have been initialized and represent three hidden states for a sequence of three words. πŸ“

We will calculate the token similarity matrix through the scalar product and then scale it by the square root of the vector dimensions. πŸ”’

scores = torch.bmm(q, k.transpose(1, 2)) / (q.shape[-1] ** 0.5)
attention_weights = F.softmax(scores, dim=-1)
output = torch.bmm(attention_weights, v)

The scalar product has been translated into probability weights, based on which the final contextual vector has been formed. πŸ”„

A control run of the output dimension calculation:

python3 -c "import torch; q, k = torch.randn(1, 3, 4), torch.randn(1, 3, 4); print('Attention OK') if torch.bmm(q, k.transpose(1, 2)).shape == (1, 3, 3) else print('Error')"

Expected output: Attention OK βœ…

The Self-Attention formula lies at the heart of all modern LLMs, allowing them to process long contexts in parallel, unlike old recurrent networks (RNNs). Understanding this base is critically important for working with transformers, optimizing architectures and configuring KV-cache mechanisms. πŸš€πŸ§ 

#PyTorch #Transformer #DeepLearning #AI #MachineLearning #LLM

✨ Join Best TG Channels https://xn--r1a.website/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
Please open Telegram to view this post
VIEW IN TELEGRAM
❀4