Step 6 · Think: AutoEncoders & clustering

after class · ~60 min
1 Setup 2 Hello 3 Data 4 Analyze 5 CNN 6 Think

You made it through the whole loop: download → explore → analyze → fit → iterate. Now, one last idea to take home. It is homework — this time there is no example output; your agent's answer is the assignment.

Think · AutoEncoders: compressing 25,000 waveforms

You have 25,000 waveforms. Nobody can look at 25,000 waveforms one by one. Big data needs compression and organization — which is exactly what an AutoEncoder is for.

idea: train a network to squeeze each waveform into a tiny latent space and reconstruct it back — then use the latent vectors to cluster events and organize the whole dataset.

Part 1 · The concept

Ask your agent to teach you:

Explain AutoEncoders to me: what is the encoder, the latent space, and the decoder? Why does compressing a waveform into a small latent space force the network to learn its essential features? Give a simple analogy.

Part 2 · Train one on the waveforms

Train a small AutoEncoder on hsr_waveform_velocity.npz: compress each 2500-sample waveform into a latent vector of 8-32 numbers, then reconstruct it. Show original vs reconstructed waveforms for a few events — how well does it reproduce them? Where does it lose information (e.g., noise vs the train signal)? Save the figure.

Part 3 · Cluster the events

Using the latent vectors of many events, project them to 2D (PCA or t-SNE) and color them by: (a) true train speed, (b) station, (c) direction. Do natural clusters appear? Which property organizes the latent space the most? Save the figure. Then answer: how does this help analyze a 25,000-event dataset — can we pick one representative waveform per cluster instead of looking at everything?

Think about it

  1. The AutoEncoder never sees the speed labels — yet the latent space may organize by speed. Why? What does that say about the waveform's information content?
  2. Where does the reconstruction fail first — the sharp train signal or the noise? What does that tell you about what the latent space keeps?
  3. How would you use this in your own field (seismology, exploration, geodesy...) to summarize a huge dataset before diving into it?
  4. Did your agent implement everything, or did it hand-wave the hard parts? Push it until the figures exist.
Deliverable: two figures (reconstruction + latent-space clusters) and a short paragraph answering the three questions. The agents were free — judge their work like a boss.
That's the whole lab. You taught an agent to download data, analyze it, build a network, fit train speeds, iterate — and now you know how to squeeze an entire dataset into a latent space. In two hours you went from "what is an AI agent?" to directing a team of AI engineers. The loss function was you — all along.