Urgent:Injured stray dog seen near Kanki Dham Temple,Uttar Dinajpur(WB). Brown dog with black face, severe wound near eyes/nose (possibly maggots).Dog was moving around temple area.Please help or alert local rescuers
@pfaindia@PetaIndia@BlueCrossIndia
#AnimalRescue#HelpAnimals
জরুরি: উত্তর দিনাজপুরের কাঁকি ধাম মন্দিরের কাছে গুরুতর আহত একটি পথকুকুর দেখা গেছে (চোখ/নাকের কাছে ক্ষত, সম্ভবত পোকা)। দয়া করে কেউ সাহায্য করুন বা স্থানীয় রেসকিউ টিমকে জানান।।
@pfaindia@PetaIndia@BlueCrossIndia@KankidhamK
#AnimalRescue#HelpAnimals
Which is the smallest LLM that can realistically be fine-tuned on a 16GB RAM machine (CPU only, no GPU)?
Ideally something that can be done with simple code (for example, using nanoGPT, nanochat by Andrej Karpathy) so the fine-tuning process is easy to understand.
Not worried about the use case as this is purely for educational purposes.
Any suggestions?
Why does Attention use Softmax?
First, try to understand: What attention is trying to compute?
Given a query, it wants to decide: Where should I look more? Where less?
Assume the raw attention scores are: [2, 1, 0]
What if we don't use softmax at all? Let's try using the raw scores and the sigmoid function.
Using Raw scores
raw score = [2, 1, 0]
output = 2·v1 + 1·v2 + 0·v3
This looks fine, but:
• Weights don't sum to 1
• Scale keeps increasing as layers stack
• You can't say "this token mattered X%"
Using Sigmoid
sigmoid(scores) = [0.88, 0.73, 0.50]
sum = 2.11
output = 0.88·v1 + 0.73·v2 + 0.50·v3
• Weights don't sum to 1
• Everyone gets attention
• No competition
• Model can't "choose"
The model is basically saying: "I like all of you."
Using Softmax
softmax(scores) = [0.66, 0.24, 0.10]
sum = 1
output = 0.66·v1 + 0.24·v2 + 0.10·v3
• Weights sum to 1
• All values are positive
• If one token gets more attention, others must get less
Softmax forces attention to choose.
How is Calculus used in Machine Learning Model Training?
Calculus helps in optimizing the model by updating parameters to reduce error.
Calculus Concepts Used: Derivatives, Partial Derivatives, Gradients, Chain Rule
• Derivatives: Measure how a small change in one parameter affects the output or loss.
• Partial Derivatives: Measure the effect of changing one variable while keeping others constant in multivariable functions.
• Gradients: Vectors of partial derivatives that point in the direction of steepest increase in loss.
• Chain Rule: Allows computation of derivatives through nested functions, enabling backpropagation in neural networks.
That's it for now.
RecyclerView Optimization: Fix Image Flickering
Avoid UI flicker by fixing the ImageView size ahead of time.
Today, we are going to understand a simple RecyclerView optimization that improves scrolling and removes image flickering.
Read here: https://t.co/bX9hKo4WTs
What residual (skip) connections do in Transformers
In a Transformer block, you’ll always see patterns like:
x = x + f(x)
That is the residual connection.
It allows the model to learn a refinement on top of the input, rather than learning everything from scratch.
So, residual connections let layers add knowledge instead of replacing it.
Let's try to understand with an analogy.
Imagine you are learning a topic over a period of time.
Without a residual (skip) connection: x = f(x)
• Whatever you learn each day, you REWRITE your notes from scratch.
• Old knowledge is NOT preserved.
With a residual (skip) connection: x = x + f(x)
• You keep your existing notes and only add what is useful from today's learning.
• Old knowledge is preserved.
• If today's lesson isn't useful, you add nothing.
This is what residual (skip) connections do in Transformers.
Keep Learning, Keep Sharing, and Keep Growing.
Designing a Logging Library in Android Interview
Logs are not just print statements. They help you understand what happened when something breaks.
The key components to consider during a design interview discussion:
- Logging API: debug, info, warn, error.
- Log Levels & Filtering: Control verbosity.
- Structured Logs: For better querying and analysis.
- Thread-Safe Logger: Logging from any thread without blocking the UI.
- Asynchronous Writer: Writes logs to disk/network off the main thread.
- Buffering Strategy: In-memory buffers to avoid IO on every log call.
- Log Format & Serialization: Timestamp, thread, tag, message.
- Persistence Layer: File system, size limits, retention policies.
- Remote Log Uploader: Batched uploads with retries and backoff.
- Privacy: Mask Personally Identifiable Information(PII), tokens, and sensitive fields.
- Testing & Debug Flags: For unit tests and local debugging.
Remember: If logs slow your app, they’re designed wrong.
#androiddev #android #interview
If you really want to understand LLMs. Code and experiment with the following:
• Tokenizers
Shows how LLMs read text as numbers, not words, why token choices affect cost and context, and how unknown words are handled. Build a BPE tokenizer.
• Embeddings
Helps you understand how words are represented as vectors, why semantic similarity emerges without explicit rules, and how word positions are encoded.
• Attention
Helps you understand how models decide what information matters in a sequence, independent of distance.
• Causal Attention
Helps you understand how LLMs prevent looking at the future, so each token depends only on the past.
• Transformers
Helps you understand how stacking simple blocks creates complex behavior and why depth matters.
• Layer Normalization
Helps you understand training stability and why the model fails without proper normalization.
• Dropout
Helps you understand generalization and why a bit of randomness prevents memorization.
• Feed-forward Network
Explains how transformers add non-linearity and transform information within each token after attention. Implementing a feed-forward network with an activation function.
• Temperature Scaling
Helps you understand the confidence vs creativity trade-off during generation.
• Top-k Sampling
Helps you understand how limiting choices prevents low-probability noise during generation.
• Quantization
Helps you understand performance vs accuracy trade-offs in real-world deployment.
• Pretraining
Teaches how models learn language structure and patterns from raw text.
• Finetuning
Helps you understand how behavior is shaped, even when the base model stays the same.
That's it for now.
Keep Learning, Keep Sharing, and Keep Growing.
During my IIT JEE prep, my favorite topics were Calculus and Probability.
After college, when I started learning to code, my favorite topic became Dynamic Programming, and it helped me get a job.
In Machine Learning, my favorite topics are CNNs and LLMs. It’s great learning the internals of CNNs and LLMs.
How does the "Where Is My Train" Android App work without the Internet?
The app displays train locations even when offline, utilizing cell phone towers.
• Your phone always connects to nearby cell towers, even without internet.
• Each tower has a unique ID and a known location.
• The app stores a database matching towers to railway tracks and stations.
So, when you are on a train, the app notices your phone switching between towers. Since it knows where each tower is located along the route, it can:
• Figure out where the train is
• Estimate delays
No GPS or internet needed.
This is how it works without the internet.
Note: When you do have internet, it fetches data from the server for better accuracy.
That's it for now.
@Livpure_India RO not working from 1 month. The service request is open and it's been more than. a month, visit.
Your area incharge/manager/zonal head do not respond to call or disconnect call.
Your customer care keeps on hold for hours and transfers calls. SR: 2511030917410078
Strategy Pattern: This pattern lets you define a family of algorithms, encapsulate them, and make them interchangeable at runtime.
Android uses this pattern heavily to allow pluggable behaviors.
Example in Android Open Source Project(AOSP): LayoutManager in RecyclerView
• Strategy Interface: LayoutManager
• Concrete Strategies: LinearLayoutManager, GridLayoutManager, StaggeredGridLayoutManager
Now we can use them as follows:
recyclerView . layoutManager = LinearLayoutManager(ctx)
// or
recyclerView . layoutManager = GridLayoutManager(ctx, 2)
The RecyclerView does NOT care how items are laid out. The layout algorithm is a Strategy.
This is how the Strategy Pattern is used in AOSP.
That's it for now.
#AndroidDev
Guaranteed Ways to Fail in Android Interviews:
• Ignoring Data Structures and Algorithms: for example, failing to code "LRUCache".
• Not practicing for the Machine Coding Round, thinking, "I already work on a big project in my company."
• Ignoring the internals: for example, failing to code "How to implement debounce using Coroutines."
• Not practicing how to explain concepts: for example, failing to explain "How ViewModel works internally".
#AndroidDev #Kotlin #Interview #Android
ConstraintLayout in Android uses the Cassowary Algorithm internally for optimization.
Learn How Android Uses a Smart Constraint Solver to Arrange Your UI Efficiently: https://t.co/DnuUDbAb6w
#AndroidDev#Android