"Bridge mathematics โ architecture โ deployment. Don't just use models. Understand, modify, and design them."
I'm an AI Engineer & Deep Learning Researcher building end-to-end intelligent systems from first principles to production. My work spans reinforcement learning, large language models, computer vision, and financial AI โ with a philosophy rooted in mathematical depth rather than surface-level API usage.
class AliKhalid:
name = "Ali Khalid"
role = "AI Engineer & Deep Learning Researcher"
location = "Egypt ๐ช๐ฌ"
expertise = {
"core" : ["Reinforcement Learning", "Deep Learning", "LLM Engineering", "FinTech AI"],
"languages" : ["Python โ
โ
โ
โ
โ
", "C++ โ
โ
โ
โโ", "JavaScript โ
โ
โ
โโ", "MATLAB โ
โ
โ
โโ"],
"frameworks" : ["PyTorch", "TensorFlow/Keras", "Stable-Baselines3", "LangChain", "HuggingFace"],
}
current = [
"๐ค PPO trading agent โ custom Gymnasium env with Sharpe-ratio reward",
"๐ฌ Transformer attention from mathematical first principles",
"๐ฆพ LangGraph multi-agent orchestration systems",
]
philosophy = "Bridge mathematics โ architecture โ deployment"
open_to = ["Research collaborations", "Freelance AI projects", "Open-source contributions"]
def say_hi(self):
print("Thanks for visiting! Let's build something intelligent together. ๐")| Section | Jump | |
|---|---|---|
| ๐ฅ | Featured Projects | RL Trading Bot ยท AI Researcher ยท LangChain/Graph ยท Multi-Model Trading |
| ๐ง | Skills | RL Algorithms ยท Classic ML ยท Deep Learning ยท Pretrained Models ยท LLM Stack |
| ๐ | Stats | GitHub Stats ยท Streak ยท Timeline |
| ๐ฏ | Now | Current Focus |
Continual Learning Image Captioning platform powered by a custom hybrid Vision-Transformer (ViT) & GPT-2 decoding engine.
| ๐ Repository | NeuralLens |
| ๐ฆ Stack | TensorFlow ยท Keras ยท Flask ยท ViT+GPT-2 |
| ๐ฏ Capability | Real-time semantic image captioning + In-browser model fine-tuning |
Architecture highlights:
- ๐๏ธ Custom built Vision-Transformer (ViT) encoder with 1D positional embeddings
- ๐ง Autoregressive GPT-2 Decoder with Cross-Attention + Custom BPE Tokenizer
- ๐จ Ultra-premium, state-of-the-art Glassmorphism web GUI
- ๐ Native hardware telemetry (
psutil+NVML)
Production-grade Deep Reinforcement Learning for autonomous stock trading with realistic market microstructure.
| ๐ Repository | Trading_bot_Reinforcment |
| ๐ฆ Stack | Stable-Baselines3 ยท Gymnasium ยท PyBroker ยท YFinance ยท Apple MPS GPU |
| ๐ฏ Reward Signal | Sharpe Ratio (risk-adjusted returns โ not raw P&L) |
| ๐ Training Result | Episode reward: โ1,000 โ +1,660 |
| โ๏ธ Market Model | Commission 0.01% + Slippage 0.5% (realistic friction) |
Architecture highlights:
- ๐๏ธ
StockTradingEnvโ fully custom Gymnasium environment (new 5-tuple API) - ๐ง
PPOwithMlpPolicyโ trained on Apple MPS for hardware-accelerated convergence - ๐พ
EvalCallback+StopTrainingOnRewardThresholdโ intelligent auto-stop on convergence - ๐ Best model persisted to
Training/Saved Models/best_model.zip
flowchart LR
A["๐ก YFinance\nOHLCV Data"] --> B["๐๏ธ StockTradingEnv\nGymnasium ยท Commission + Slippage"]
B -->|"obs: adj_close[t]"| C["๐ง PPO Agent\nMlpPolicy ยท Apple MPS GPU"]
C -->|"action: [type, amount]"| B
B -->|"reward: Sharpe Ratio"| C
C -->|"EvalCallback"| D["๐พ best_model.zip"]
D -.->|"Auto-reload on improvement"| C
โญ 6 Stars โ Framework for studying deep learning at full mathematical depth. Zero black boxes.
| ๐ Repository | AI-Researcher |
| ๐ฆ Stack | PyTorch ยท NumPy ยท Matplotlib |
| โญ Stars | 6 |
| Notebook | Module | Depth Level |
|---|---|---|
Neural_Netwok.ipynb |
Neural Foundations | Biological โ Mathematical abstraction |
Attention.ipynb |
Attention Mechanisms | Multi-Head Self-Attention from scratch |
transformation_block.ipynb |
Transformer Architecture | Full encoder/decoder โ no nn.Transformer |
math_pyhton.ipynb |
Math Visualizations | Gradients, loss landscapes, activation surfaces |
"If you want to use models โ elsewhere. If you want to understand, modify, and design models โ welcome here."
Advanced LLM middleware pipeline with dynamic model routing, context chaining, and multi-agent graph orchestration.
| ๐ Repository | langchain-and-langgraphe |
| ๐ฆ Stack | LangChain ยท LangGraph ยท Ollama ยท Python |
flowchart TD
U["๐ค User Query"] --> R["๐ Dynamic Router\nDynamic_model_choice.py"]
R -->|"Complex reasoning"| L["๐ฆ Llama 3\nvia Ollama"]
R -->|"Fast response"| M["โก Mistral\nvia Ollama"]
R -->|"Multimodal"| G["โจ Gemini API"]
L & M & G --> P["๐ Prompt Pipeline\nDynamic_prompt.py"]
P --> C["๐ LangChain Orchestrator\nlangchain3.py"]
C --> O["๐ค Structured Output"]
Hybrid quantitative analysis โ Transformer + LSTM + Random Forest ensemble for market prediction.
| ๐ Repository | Trading_model |
| ๐ฆ Stack | PyTorch ยท Scikit-Learn ยท Flet Dashboard ยท Plotly |
| Model | Role | Input Features |
|---|---|---|
| Transformer Encoder | Market regime detection | Multi-Head Attention over OHLCV sequences |
| LSTM Network | Price action forecasting | Sequential memory, momentum, temporal patterns |
| Random Forest (200 trees) | Buy/Sell signal generation | RSI, MACD, ATR, EMA, SMA technical indicators |
| Ensemble Layer | Final decision | Weighted vote across all three models |
๐ View All 31 Repositories (click to expand)
| # | Project | Primary Stack | Description | Stars | Updated |
|---|---|---|---|---|---|
| 1 | Trading_bot_Reinforcment | SB3 ยท Gymnasium | PPO trading agent, custom env | โ | Mar 2026 |
| 2 | Trading_model | PyTorch ยท Plotly | Transformer+LSTM+RF ensemble | โ | Mar 2026 |
| 3 | Reinforcement_learning_notes- | Jupyter | RL study notes | โ | Mar 2026 |
| 4 | Reinforcement_learning_projects_agents | SB3 ยท Gymnasium | Multi-domain RL agents | โ | Mar 2026 |
| 5 | AI-Researcher | PyTorch ยท NumPy | Transformers from scratch | โญ 6 | Jan 2026 |
| 6 | langchain-and-langgraphe | LangChain ยท Ollama | LLM middleware pipeline | โ | Feb 2026 |
| 7 | Moltbook_project | HTML ยท CSS | Full web book platform | โญ 1 | Feb 2026 |
| 8 | Robotics-Arm | Python ยท NumPy | Inverse kinematics control | โ | Dec 2025 |
| 9 | AI_research_project- | Python | Applied AI research | โ | Oct 2025 |
| 10 | Fraud-detection | XGBoost ยท ML | Financial fraud pipeline | โ | Oct 2025 |
| 11 | NutritionAI | HTML ยท JS | AI nutrition advisor | โญ 1 | Sep 2025 |
| 12 | Empathy-chatbot | Python ยท NLP | Emotion-aware chatbot | โ | Sep 2025 |
| 13 | flask | Python ยท Flask | REST API service | โ | Sep 2025 |
| 14 | bot | Python | Automation bot | โ | Jul 2025 |
| 15 | bot_telegram | Python | Telegram bot | โ | Jul 2025 |
| 16 | Reinforcement-Learning-Agent- | Python | First RL agent | โ | Jun 2025 |
| 17 | personal_chatbot | Python | Personal assistant | โ | Jun 2025 |
| 18 | chatbot-with-api_google | Python ยท Gemini | Google AI chatbot | โ | May 2025 |
| 19 | document-qa | LangChain | PDF Q&A system | โ | May 2025 |
| 20 | Digit-classification | CNN ยท Keras | MNIST digit recognition | โ | May 2025 |
| 21 | chatbot | Jupyter | NLP chatbot | โ | Apr 2025 |
| 22 | color-classification | CNN ยท OpenCV | Color detection CNN | โ | Apr 2025 |
| 23 | FaceMask-Project | CNN ยท OpenCV | Real-time mask detection | โ | Apr 2025 |
| 24 | Diabetes- | Scikit-learn | Medical classification | โ | Mar 2025 |
| 25 | Loan-Prediction- | Ensemble ML | Loan risk prediction | โ | Dec 2024 |
| 26 | cubic-spline-path-of-robot- | Python | Trajectory planning | โ | Dec 2024 |
| 27 | housing_price_prediction | Regression ML | House price prediction | โ | Dec 2024 |
| 28 | Mall-Customers-clustering- | K-Means | Customer segmentation | โ | Dec 2024 |
| 29 | Titanic-project- | Ensemble ML | Survival prediction | โญ 1 | Dec 2024 |
| 30 | Assiuitsheets_new_comer_solutions | C++ | Competitive programming | โ | Dec 2025 |
Implemented, tuned, and deployed via Stable-Baselines3 and from mathematical scratch.
mindmap
root((RL Expertise))
Value-Based
DQN
Deep Q-Network
Experience Replay
Target Network
Policy Gradient
PPO
Clipped Objective
Production-Ready โญ
A2C
Parallel Envs
Advantage Estimation
Actor-Critic
DDPG
Continuous Control
Robotics
TD3
Twin Critics
Reduced Overestimation
SAC
Max Entropy
Sample-Efficient
Auxiliary
HER
Sparse Rewards
Goal-Conditioned
| Algorithm | Paradigm | Action Space | Key Strength | Used In |
|---|---|---|---|---|
| DQN | Value-Based | Discrete | Atari ยท discrete control | RL Projects |
| PPO โญ | Policy Gradient | Both | Stable ยท sample-efficient ยท production | Trading Bot |
| A2C | Actor-Critic | Both | Parallel environment training | RL Projects |
| DDPG | Actor-Critic | Continuous | Robotics ยท continuous control | Robotics Arm |
| TD3 | Actor-Critic | Continuous | Reduced Q-value overestimation | RL Projects |
| SAC | Actor-Critic | Continuous | Maximum entropy ยท sample-efficient | RL Projects |
| HER | Auxiliary | Both | Sparse reward environments | RL Projects |
๐ Regression Models (13 algorithms)
| Model | Library | Regularization | Best For |
|---|---|---|---|
| Linear Regression | scikit-learn |
None | Baseline, interpretability |
| Ridge Regression | scikit-learn |
L2 | Multicollinearity, stable coefficients |
| Lasso Regression | scikit-learn |
L1 | Sparse solutions, feature selection |
| ElasticNet | scikit-learn |
L1+L2 | Combined regularization |
| Polynomial Regression | scikit-learn |
โ | Non-linear relationships |
| SVR | scikit-learn |
โ | Kernel-based, high-dim data |
| Decision Tree Regressor | scikit-learn |
โ | Interpretable, non-linear |
| Random Forest โญ | scikit-learn |
Bagging | Robust ensemble predictions |
| Gradient Boosting | scikit-learn |
Boosting | Sequential error correction |
| XGBoost โญ | xgboost |
Boosting | Competition-grade performance |
| LightGBM | lightgbm |
Boosting | Large-scale, fast training |
| KNN Regressor | scikit-learn |
โ | Non-parametric baseline |
| Bayesian Ridge | scikit-learn |
Probabilistic | Uncertainty-aware regression |
๐ Classification Models (14 algorithms)
| Model | Library | Paradigm | Best For |
|---|---|---|---|
| Logistic Regression | scikit-learn |
Linear | Baseline, interpretable |
| SVC | scikit-learn |
Kernel | High-dim, margin classification |
| Decision Tree | scikit-learn |
Tree | Interpretable rules |
| Random Forest โญ | scikit-learn |
Bagging | Robust, 200+ trees |
| Gradient Boosting | scikit-learn |
Boosting | Sequential learners |
| XGBoost โญ | xgboost |
Boosting | Competition-grade |
| LightGBM โญ | lightgbm |
Boosting | Fast, large-scale |
| AdaBoost | scikit-learn |
Adaptive | Weak learner combination |
| Naive Bayes | scikit-learn |
Probabilistic | Text, fast inference |
| KNN | scikit-learn |
Distance | Non-parametric |
| LDA | scikit-learn |
Dimensionality | Linear class boundaries |
| QDA | scikit-learn |
Dimensionality | Non-linear boundaries |
| Extra Trees | scikit-learn |
Extreme Rand | Fast, decorrelated trees |
| MLP Classifier | scikit-learn |
Neural | Shallow neural net |
๐ต Unsupervised / Clustering (6 algorithms)
| Model | Type | Applied In |
|---|---|---|
| K-Means โญ | Centroid | Mall customer segmentation |
| DBSCAN | Density | Anomaly/outlier detection |
| Hierarchical / Agglomerative | Tree | Dendrogram-based grouping |
| Gaussian Mixture Models (GMM) | Probabilistic | Soft cluster assignment |
| PCA | Reduction | Dimensionality reduction pipeline |
| t-SNE | Reduction | High-dimensional visualization |
| Architecture | Depth Level | Key Concepts | Applied Projects |
|---|---|---|---|
| Feedforward (MLP) | โ โ โ โ โ | Backprop, activations, optimizers | Trading, classification |
| CNN | โ โ โ โ โ | Convolution, pooling, BatchNorm | FaceMask, Digit, Color |
| LSTM / GRU | โ โ โ โ โ | Gated memory, time-series | Trading forecasting |
| Transformer / Attention | โ โ โ โ โ | Multi-Head Self-Attention, positional encoding | AI-Researcher, Trading |
| Hybrid Ensembles | โ โ โ โ โ | Deep + classical combination | Multi-Model Trading |
| Autoencoder | โ โ โ โโ | Unsupervised representation learning | Anomaly detection |
| PPO / Actor-Critic nets | โ โ โ โ โ | Policy + value network architecture | RL Trading Agent |
# Transformer Attention โ built from scratch in AI-Researcher
import torch
import torch.nn as nn
import math
class MultiHeadSelfAttention(nn.Module):
def __init__(self, d_model: int, n_heads: int):
super().__init__()
assert d_model % n_heads == 0
self.d_k = d_model // n_heads
self.n_heads = n_heads
self.W_q = nn.Linear(d_model, d_model)
self.W_k = nn.Linear(d_model, d_model)
self.W_v = nn.Linear(d_model, d_model)
self.W_o = nn.Linear(d_model, d_model)
def scaled_dot_product(self, Q, K, V, mask=None):
scores = torch.matmul(Q, K.transpose(-2, -1)) / math.sqrt(self.d_k)
if mask is not None:
scores = scores.masked_fill(mask == 0, float('-inf'))
return torch.matmul(torch.softmax(scores, dim=-1), V)
def forward(self, x):
B, T, D = x.shape
Q = self.W_q(x).view(B, T, self.n_heads, self.d_k).transpose(1, 2)
K = self.W_k(x).view(B, T, self.n_heads, self.d_k).transpose(1, 2)
V = self.W_v(x).view(B, T, self.n_heads, self.d_k).transpose(1, 2)
attn = self.scaled_dot_product(Q, K, V)
out = attn.transpose(1, 2).contiguous().view(B, T, D)
return self.W_o(out)๐ผ๏ธ Computer Vision โ Pretrained Backbone Models
| Model | Architecture | Parameters | Specialty |
|---|---|---|---|
| VGG-16 | Very Deep Conv | 138M | Transfer learning baseline |
| VGG-19 | Very Deep Conv | 143M | Fine-tuning, feature extraction |
| ResNet-50 | Residual (skip connections) | 25M | โญ Widely used transfer learning |
| ResNet-101 / 152 | Deep Residual | 44M / 60M | High-accuracy recognition |
| EfficientNet-B0 โ B7 | Compound scaling | 5โ66M | โญ Best accuracy-per-FLOP |
| MobileNetV2 / V3 | Depthwise separable | 3โ5M | Edge, mobile inference |
| InceptionV3 | Inception modules | 23M | Multi-scale feature capture |
| DenseNet-121 / 201 | Dense connections | 8โ20M | Medical imaging |
| ViT (Vision Transformer) | Patch-based Transformer | 86M+ | โญ SOTA image classification |
| CLIP (OpenAI) | Contrastive vision-language | 400M | Zero-shot classification |
| DETR | Detection Transformer | 41M | Anchor-free object detection |
๐ NLP & LLM โ Pretrained Language Models
| Model | Type | Parameters | Key Use Case |
|---|---|---|---|
| BERT / RoBERTa | Encoder | 110Mโ125M | Classification, NER, Q&A |
| GPT-2 | Decoder | 117Mโ1.5B | Text generation |
| DistilBERT | Distilled Encoder | 66M | Fast inference, mobile NLP |
| T5 / FLAN-T5 | Enc-Dec | 60Mโ11B | Summarization, translation |
| Llama 2 / 3 (Ollama) | Decoder LLM | 7Bโ70B | Local chatbot, reasoning |
| Mistral (Ollama) | Decoder LLM | 7B | Fast local inference |
| Gemini API | Multimodal | โ | Google AI integration |
# Transfer Learning workflow โ from AI projects
from torchvision.models import efficientnet_b0, EfficientNet_B0_Weights
import torch.nn as nn
def build_classifier(num_classes: int, freeze_backbone: bool = True):
backbone = efficientnet_b0(weights=EfficientNet_B0_Weights.IMAGENET1K_V1)
if freeze_backbone:
for param in backbone.features.parameters():
param.requires_grad = False # Freeze pretrained weights
in_features = backbone.classifier[1].in_features
backbone.classifier = nn.Sequential(
nn.Dropout(p=0.3, inplace=True),
nn.Linear(in_features, 512),
nn.ReLU(),
nn.Dropout(p=0.2),
nn.Linear(512, num_classes)
)
return backbone| Tool | Capability | Used For |
|---|---|---|
| LangChain | Middleware chains, prompt templates, memory, context passing | langchain-and-langgraphe |
| LangGraph | Stateful multi-agent graph workflows | Agent orchestration |
| Ollama | Local LLM runtime โ Llama 3, Mistral, CodeLlama | Private inference |
| Gemini API | Google multimodal AI integration | Chatbot ยท NutritionAI |
| HuggingFace Transformers | Model hub, fine-tuning, inference pipelines | NLP downstream tasks |
| Competency | Detail |
|---|---|
| Feature Engineering | Rolling statistics, RSI, MACD, ATR, volatility signals, lag features |
| Data Cleaning | Missing-value imputation strategies, outlier detection (IQR, Z-score, IsoForest) |
| Model Evaluation | CV, confusion matrices, ROC-AUC, Sharpe Ratio, F1, MAE, RMSE |
| Visualization | Interactive dashboards (Plotly/Flet), trade charts, loss/reward curves, SHAP plots |
timeline
title Ali Khalid โ AI Engineering Journey (Dec 2024 โ Mar 2026)
Dec 2024 : ๐ฑ Classic ML Foundations
: Titanic ยท Housing Prices ยท Mall Clustering ยท Loan Prediction
Mar 2025 : ๐๏ธ Computer Vision
: FaceMask Detection ยท Digit Classification ยท Diabetes Prediction
Apr 2025 : ๐ฌ NLP & Chatbots
: NLP Chatbot ยท Color Classification with CNN
Jun 2025 : ๐ฎ RL Fundamentals
: First RL Agent ยท Personal Chatbot
Jul 2025 : ๐ค LLM Engineering
: Telegram Bot ยท Google Gemini API Integration
Sep 2025 : ๐งฌ Advanced LLM Systems
: Empathy Chatbot ยท NutritionAI ยท Flask REST APIs
Oct 2025 : ๐ฌ Applied AI Research
: Fraud Detection ยท AI Research Projects
Dec 2025 : ๐ฆพ Robotics & Path Planning
: Robotics Arm (IK) ยท Cubic Spline Trajectory
Jan 2026 : ๐ง Deep Architecture Research
: AI-Researcher โ Transformers & Attention from Scratch (โญ6)
Feb 2026 : ๐ Agentic LLM Systems
: LangChain Middleware ยท LangGraph Multi-Agent ยท Moltbook
Mar 2026 : ๐ Financial Reinforcement Learning
: Multi-Model Trading System ยท PPO Agent ยท Custom Gymnasium Env
May 2026 : ๐๏ธ Continual Learning ViT Architecture
: NeuralLens โ ViT & GPT-2 Image Captioning Platform
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CURRENT DEVELOPMENT FOCUS โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
โ โ
โ ๐ค RL Algorithmic Trading โ
โ โโโ Custom Gymnasium envs with realistic market microstructure โ
โ โโโ Sharpe-Ratio reward shaping + risk management constraints โ
โ โโโ PPO / SAC training ยท Apple MPS GPU acceleration โ
โ โ
โ ๐ง Deep Learning Architecture Research โ
โ โโโ Transformer / Attention from pure mathematical first principles โ
โ โโโ Goal: architectural design capability โ not just usage โ
โ โ
โ ๐ค Pretrained Model Fine-tuning โ
โ โโโ EfficientNet / ViT transfer learning pipelines โ
โ โโโ HuggingFace downstream task fine-tuning โ
โ โ
โ ๐ Agentic LLM Systems โ
โ โโโ LangChain design patterns for production middleware โ
โ โโโ LangGraph stateful multi-agent orchestration โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ