meichinpang
  • Home
  • About
  • Blogs
  • Publications
Categories
All (15)
AI workflows (1)
asyncio (1)
coroutines (1)
gradient descent (1)
graph-rag (3)
linear regression (1)
LLM (4)
neo4j (3)
neural-networks (5)
PINN (5)
polynomial regression (1)
pytorch (10)
reflection (1)
SciML (8)
travel (1)
wildlife (1)

Finding Similarities in a Graph

graph-rag
neo4j
LLM

Similarity between entities falls out naturally from the relationships they share. This post uses Cypher to find playlists that overlap, then ranks them by how many tracks they share and how closely those tracks line up.

Aug 20, 2026
Mei-Chin Pang

Avoiding Duplicated Nodes in Neo4j with MERGE

graph-rag
neo4j
LLM

When loading data into a Neo4j knowledge graph, CREATE blindly inserts a new node every time, leaving duplicated, disconnected entities. This post explains why MERGE is the safer choice because its match-first-then-create behaviour prevents duplicated nodes.

Aug 18, 2026
Mei-Chin Pang

Understanding the Fundamentals of Graph Retrieval-Augmented Generation (RAG) in LLMs

graph-rag
neo4j
LLM

Graph Retrieval-Augmented Generation (RAG) combines the power of graph databases with large language models (LLMs) to enable more accurate and context-aware information retrieval. This post explores the fundamentals of Graph RAG, including its architecture, key components, and how it leverages graph structures to enhance LLM capabilities. It also walks through installing Neo4j on Ubuntu, from the Java prerequisite and APT repository setup to starting the service and accessing the browser interface.

Aug 17, 2026
Mei-Chin Pang

Dynamic PINNs (5): Identifying Unknown Parameters using Inverse PINNs

pytorch
SciML
PINN

An inverse PINN learns not just the solution to an ODE, but also an unknown physical parameter from noisy data. This notebook tackles the Duffing oscillator, treating the cubic stiffness alpha as unknown and recovering it from 250 noisy displacement measurements. We walk through the full pipeline, from ground-truth generation with solve_ivp, synthetic noise, input/output normalisation, and a three-part loss (IC, physics residual, data) to observing how the alpha parameter converges from zero to its true value over 30,000 training epochs.

Jun 20, 2026
Mei-Chin Pang

Dynamic PINNs (4): Solving Coupled ODEs with PINNs

pytorch
SciML
PINN

This notebook extends the hybrid PINN approach to a double pendulum, a system of two coupled nonlinear ODEs. A single network with two outputs learns both angles simultaneously, with per-angle normalisation and two ODE residuals enforced in the physics loss. Curriculum training over five progressive time windows and a reduced physics loss weight help the network learn the oscillatory dynamics accurately. The equations of motion, the first-order conversion for numerical integration, and the training setup are walked through step by step.

May 29, 2026
Mei-Chin Pang

Dynamic PINNs (3): Solving a Non-Linear ODE across a Range of Pendulum Lengths with a Parameterised PINN

pytorch
SciML
PINN

This notebook extends the fixed-length PINN to a parameterised setting where the pendulum length L is treated as a variable input. A single network learns the solution for any L in [0.5, 1.5] m, eliminating the need to retrain for each design point. We compare the parameterised loss functions, training loop, and predictions against numerical ground truth at multiple L values.

May 9, 2026
Mei-Chin Pang

Dynamic PINNs (2): Solving a Non-Linear ODE with a Physics-Informed Neural Network

pytorch
SciML
PINN

This notebook compile a step-by-step guide to solving the damped pendulum equation using a PINN in PyTorch, from deriving the equation of motion, building the network and training with a physics-based loss to comparing results against a numerical ODE solver.

May 1, 2026
Mei-Chin Pang

Dynamic PINNs (1): Understanding Physics-Informed Neural Networks from Scratch

pytorch
SciML
PINN

This notebook describes a step-by-step introduction to PINNs, starting from a hand-computed forward pass through a minimal network, understanding automatic differentiation and the impacts of different activation functions for PINNs to a simple PINN that solves the undamped spring-mass ODE without any labelled data.

Apr 25, 2026
Mei-Chin Pang

Understanding the Mechanisms beneath Gradient Descent

pytorch
gradient descent
linear regression
SciML
neural-networks

How does gradient descent find the best parameters for a model? This notebook explores how a linear regression model recovers unknown slope and intercept by minimizing a loss function, what the error surface looks like in 2D and 3D, and how partial derivatives and gradient vectors guide each optimization step.

Apr 7, 2026
Mei-Chin Pang

The Building Blocks of a Neural Network: Layers, Activations, Loss Functions, and Optimizations

pytorch
SciML
neural-networks

What makes a neural network learn? This notebook walks through the core building blocks such as layers, activation functions, loss functions, and optimizers and puts them together in PyTorch to train a small MLP that classifies battery cell performance outliers.

Mar 21, 2026
Mei-Chin Pang

Automatic Differentiation and Polynomial Regression in PyTorch

pytorch
polynomial regression
SciML
neural-networks

An introduction to neural network fundamentals using PyTorch’s autograd for automatic differentiation, demonstrated through polynomial regression to recover unknown coefficients.

Mar 14, 2026
Mei-Chin Pang

Shaping Up: A Hands-On Guide to Tensor Manipulation in PyTorch

pytorch
neural-networks

Learn how tensors work in PyTorch, from simple scalars to 3D arrays. This notebook walks through creating and reshaping tensors, understanding dimensions, and using operations like squeeze, unsqueeze, ravel, reshape, transpose, and stacking/splitting to manipulate tensor shapes.

Mar 7, 2026
Mei-Chin Pang

Tensors in Action: From Element-wise Math to Matrix Multiplication in PyTorch

pytorch
neural-networks

A hands-on guide to tensor operations in PyTorch covering common element-wise operations, statistical aggregations, NaN detection, the vector dot product, matrix multiplication with torch.matmul and the @ operator, singular value decomposition (SVD), and visualising a 3D saddle surface with torch.meshgrid and matplotlib.

Mar 7, 2026
Mei-Chin Pang

Cooking with Coroutines: A Hands-On Guide to Asynchronous Programming in Python

LLM
asyncio
coroutines
AI workflows

A hands-on guide to Python’s asynchronous framework that uses a cooking analogy to explain coroutines, the event loop, and concurrent I/O. Includes runnable examples for Jupyter and scripts, plus notes on using async patterns in AI workflows and reproducible multi-model pipelines.

Feb 1, 2026
Mei-Chin Pang

Galápagos: Encounters with Tortoises, Boobies, and Sea Lions

travel
reflection
wildlife

Photos and reflections from snorkeling, island walks, and wildlife watching in the Galápagos Islands, including encounters with giant tortoises, blue-footed boobies, sea lions, and sharks in their natural habitats.

Jan 3, 2026
Mei-Chin Pang
No matching items