Today I explored Dense Passage Retrieval (DPR) and how it can be used to find relevant context for a question.
🔹 DPRContextEncoderTokenizer
Converts text into tokens that the encoder can understand, while handling padding, truncation and attention masks.
🔹 DPRContextEncoder
Takes those tokens and converts an entire passage into a dense vector embedding that captures its semantic meaning.
I also looked at the other side of DPR:
🔹 Question Encoder + Tokenizer
Converts a user's question into a dense embedding.
🔹 Context Encoder + Tokenizer
Converts documents or passages into embeddings.
The interesting part is that we can compare the question embedding with the context embeddings to find the passages that are most relevant to the question.
📌 This is where FAISS comes in. It allows us to efficiently search the vector index and find contexts that are closest to the question embedding.
The bigger picture is starting to make sense:
Question → Embedding → FAISS Search → Relevant Context → Better Answer
This feels like an important building block for understanding Retrieval-Augmented Generation (RAG) and how we can improve the context provided to an LLM.
#AI #MachineLearning #NLP #RAG #LLM #DeepLearning #Python #100DaysOfAI
🧠 Day 71 of Diving into AI/ML
Dived deeper into calculus today:
Understood dependent & independent variables
Explored multivariable calculus and solved examples
Learned what the Jacobian is and how to visualize it with contours
Next step: exploring real-world applications of the Jacobian.
#AI #MachineLearning #100DaysOfML
🧠 Day 70 of Diving into AI/ML (Learnt over a span of week)
Today was a big step deeper into linear algebra:
🔹 Saw how matrices perform linear transformations.
🔹 Learnt Gaussian elimination to find matrix inverses.
🔹 Explored change of basis & the Gram-Schmidt process to build an orthonormal basis (where AT=A−1A^T = A^{-1}AT=A−1). Helps simplify the calculations
🔹 Discovered eigenvectors (vectors that stay the same after transformation) & eigenvalues (the scaling factor).
🔹 Connected it all to Google’s PageRank, where eigenvectors/values explain how backlinks decide the “importance” of a page.
Will be diving into calculus ahead.
#100DaysOfML #AI #LinearAlgebra
Watched Salaam Bombay today, it truly moved me.
It captures the harsh realities of life on the streets of Mumbai. The poverty, the struggles, and the way children grow up amidst it all. Though released around 1988, the story feels timeless.
It’s the story of a young boy, forced by his mother to earn 500 rupees before he can return to his village. His journey shows how, even with hard work and determination, life’s adversities can still break you down.
Touched
#SalaamBombay #SpiritofMumbai
#Mumbai #movie
Day 69 of Diving into AI/ML
After a short break (was down with some illness + personal stuff), I’m back at it. Today I brushed up on projections and change of basis in linear algebra.
I started with scalar and vector projections.Then I revisited the idea of a basis.
A basis is just a set of linearly independent vectors that can describe an entire space.
Change of basis is where it gets interesting.
It’s about describing the same data in a different coordinate system.
With orthogonal vectors, life is easy.
With non-orthogonal ones, you’ve got to pull out matrices.
What clicked for me is why change of basis matters in ML. Changing the basis uncovers patterns, reduce noise, or make data line up better for things like PCA or regression lines.
Feels good to be back learning. The math is heavy at times, but it’s also kind of beautiful when you see the connections.
#100DaysOfML #AI #MathForML
🧠 Day 68 of Diving into AI/ML
Today I deepened my understanding of linear algebra concepts that power ML models.
1️⃣ Dot Product – Measures alignment between vectors.
Positive = same direction, zero = perpendicular, negative = opposite.
Think of it as a projection.
2️⃣ Cross Product (3D) – Returns a vector ⬆️ perpendicular to both inputs.
Magnitude = area of the parallelogram they span.
3️⃣ Matrix Inverse - If A transforms a vector, A⁻¹ brings it back. Only works if A is square & full-rank. 🔁
4️⃣ Linear Transformation – Stretch, rotate, flip, or squash vectors via matrices. Always sends origin to origin, preserves lines. 🔄
5️⃣ Duality – Vectors not just as directions, but as functions measuring other vectors.
#100DaysOfML #LinearAlgebra #AI #DeepLearning #MathForML #NeuralNetworks #Python
🧠 Day 67 of Diving into AI/ML
TIL about Vectors & Matrices
🔹 Mastered vector arithmetic: addition, subtraction, scalar multiplication
🔹 Understood linear dependence vs. independence
🔹 Learned to calculate the determinant and its role in scaling/invertibility
🔹 Realized why matrices are often called transformations, i.e how they rotate, scale, or shear space.
Next up: dive deeper into eigenvalues, projections, and matrix decompositions!
P.S. Relearning concepts from undergrad, 3Blue1Brown makes it all click again 🔁🎥
https://t.co/YQ2NS8yjb5
#100DaysOfML #MachineLearning #AI #LinearAlgebra #Vectors #Python #DeepLearning
Day 66 of Diving into AI/ML
🧠 TIL about Neural Networks (NNs) -- diving into the AI/ML world after getting comfortable with Python!
• NNs are made of nodes (neurons) organized in layers—input, hidden, and output—connected via weighted links.
• Each node applies an activation function like ReLU, Sigmoid, or Softplus to transform data.
• Learning happens through backpropagation—errors are sent backward to adjust weights using chain rule.
• Weights and biases are the key parameters a NN learns.
• Example explored: medicine dosage vs efficiency—how hidden layers capture non-obvious patterns.
• NNs can approximate complex functions—think of it as fitting the right squiggle to the data.
🔍 Next up: diving deeper into the math behind activations, gradients, and optimization.
#NeuralNetworks #DeepLearning #AI #MachineLearning #TIL
📍Day 64 of Diving in Python
Explored the Nobel Prize dataset with data visualizations:
• Created choropleth maps to visualize prize distribution by country
• Used bar & sunburst charts to show segments across categories
• Plotted best-fit lines by category using Seaborn.lmplot() with hue, row, lowess
• Compared box plots with time series for richer insights
• Visualized distribution & descriptive stats using histograms
📊 Key Insights:
• Nobel laureates range from 17 to 97 years old
• 📈 Avg age = 59, with both young & old winners in recent years
• 🌍 Pre-WW2: US, UK, Germany were top. Post-WW2: US dominates by far
• 📅 Timeline shows rising diversity in winners across decades
Next: Dive deeper into trendlines & advanced statistical visualizations.
#Python #DataScience #Seaborn #Plotly #NobelPrize #100DaysOfCode #DataVisualization
🧠 https://t.co/bHFmDLAKWD wasn’t built to scale.
It was launched in 2007 on custom PHP, it grew massive before a major rewrite.
In 2017, they migrated to Symfony to help with scaling issues.
Today, ~80% of their revenue comes from premium subs.
#SoftwareEngineering#Chess #PHP
Day 63 of Diving in Python 🐍
Dived into data cleaning, visualization & regression with a movies dataset 🎬📊
• Cleaned messy columns using nested loops
• Filtered data using .loc[] & .query()
• Created bubble charts with Seaborn & styled them
• Converted years into decades using floor division
• Applied linear regression with Seaborn & scikit-learn
• Predicted revenue based on movie budget
📈 Insight: Every $1 increase in budget leads to ~$3.5 increase in revenue.
Budgets and movie releases have skyrocketed since 1975.
Next up: Diving deeper into the algebra behind regressions to better understand the math 🔍
#Python #DataScience #100DaysOfCode #Pandas #Seaborn #MachineLearning #DataVisualization #Regression #Movies #PythonLearning