Tutorials

The tutorials walk you through complete, runnable examples that demonstrate how to use PyHDC to solve real problems. Each tutorial introduces new concepts progressively, so reading them in order is recommended for beginners.

Recommended order

#

Title

Audience

What you will learn

1

Tutorial 1: Encoding Text for Classification

Beginner

Codebooks, n-gram encoding, class prototypes, similarity-based classification

2

Tutorial 2: Associative Memory with Key-Value Binding

Beginner-Intermediate

Key-value binding, record construction, noisy query, capacity limits

3

Tutorial 3: GPU-Accelerated HDC with PyTorch

Intermediate

PyTorch backend, GPU encoding, batched operations, performance profiling

4

Tutorial 4: (Sparse) Binary Encodings (BSC and BSDC)

Intermediate

BSC, BSDC density control, BSDC_THIN, sequence encoding, similarity remapping

5

Tutorial 5: Implementing a Custom Encoding

Intermediate-Advanced

Subclassing Encoding, EncodingSpec, wiring components, custom inverse / permute / normalize

6

Tutorial 6: Custom Generators and Reproducibility

Intermediate-Advanced

Seeded generators, generator families, reproducibility, custom generator subclass

Tutorials 3-6 are independent of each other: you can read them in any order after completing Tutorials 1 and 2.