Skip to content

Commit 274aae7

Browse files
committed
updated project 5
1 parent c765130 commit 274aae7

File tree

1 file changed

+37
-32
lines changed

1 file changed

+37
-32
lines changed

08-short-projects/project-5/project5-description-jax-nbody.md

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ Softening models the smoothing effect of finite stellar radii. For star clusters
230230

231231
#### Two Implementation Strategies
232232

233-
**Strategy A: Direct Vectorization (Pairwise Distance Matrix)**
233+
**Strategy A: Direct Vectorization (Pairwise Distance Matrix).**
234234

235235
Implement a function `accelerations_matrix(x, m, eps2, G)` that:
236236

@@ -607,40 +607,44 @@ import jax_nbody.samplers as samplers
607607

608608
**Quickstart for grading**: `quickstart.py` at project root that runs N=64 for 100 steps on CPU and prints: wall-time (after JIT warmup), `max|ΔE/E|`, and $\alpha_{\rm vir}$ summary. I will run `python quickstart.py` to verify basic functionality
609609

610-
### 2. Technical Report (4-5 pages)
610+
### 2. Research Memo (1-2 pages)
611611

612-
Write a technical report demonstrating your understanding of JAX and the design tradeoffs you made. Your report must include:
612+
Write a concise research memo demonstrating your implementation works correctly and that you understand JAX's performance advantages. **The primary deliverable is your complete working, validated pipeline**—the memo provides essential evidence and commentary.
613613

614614
**Required Components**:
615615

616-
1. **Algorithm Design** (1-1.5 pages):
617-
- Initial conditions implementation (IMF, Plummer, virial velocities)
618-
- Force calculation strategy choice and justification
619-
- Integration scheme (leapfrog DKD)
620-
- Adaptive timestepping approach
621-
- **Softening policy**: State your $\epsilon$ choice (constant vs. $\epsilon \propto r_h/\sqrt{N}$), the value/factor used, and 2-line justification tied to energy drift and timestep collapse rates
616+
1. **Validation Evidence** (≈1 page):
617+
- **All 6 required test results** with key figures showing correctness
618+
- **Two-body orbit plot**: Energy conservation ($\max|\Delta E/E| < 10^{-8}$)
619+
- **Virial equilibrium plot**: $\alpha_{\rm vir} = 1 \pm 0.05$ for virialized cluster
620+
- **Multi-scale validation**: Show correct physics from N=2 → N=100+ → production-scale clusters
621+
- Use informative captions explaining what each plot demonstrates
622622

623-
2. **Performance Analysis** (1-1.5 pages):
624-
- JAX vs. NumPy speedup (quantified with timings)
625-
- **Force strategy comparison table**: Matrix vs. vmap for N=32, 64, 128 showing measured error and wall time
626-
- Scaling analysis: How does runtime scale with N?
627-
- Profiling insights (what dominates runtime?)
623+
2. **Performance Analysis** (≈0.5 pages):
624+
- **JAX vs. NumPy speedup table**: Quantified timings for representative N values
625+
- **Force strategy comparison**: Matrix vs. vmap measured error and wall time (N=32, 64, 128)
626+
- **Brief commentary**: What dominates runtime? How does performance scale with N?
628627

629-
3. **Validation Results** (1 page):
630-
- Evidence that all 6 required tests pass (include key figures/values)
631-
- Two-body orbit energy conservation plot
632-
- Virial equilibrium verification ($\alpha_{\rm vir} = 1 \pm 0.05$)
633-
- Multi-scale validation (N=2 → N=100+ → N=200-500 clusters)
628+
3. **Key Design Decisions** (≈0.5 pages):
629+
- **Softening policy**: State your $\epsilon$ choice (constant vs. $\epsilon \propto r_h/\sqrt{N}$), the value/factor used, and brief justification tied to energy drift and timestep stability
630+
- **Integration approach**: Note your adaptive timestepping strategy
631+
- **Production ensemble**: Brief description of automated pipeline (50-100 runs, parameter coverage, data organization)
634632

635-
4. **Production Pipeline** (0.5-1 page):
636-
- Automated simulation ensemble description (50-100 runs)
637-
- Parameter space coverage (N, scale length $a$, mass range)
638-
- Statistical validation plot demonstrating ensemble consistency
639-
- Data organization and reproducibility approach
633+
**Format**: Emphasize showing results over prose. Use tables and figures effectively. Quantify performance gains. Demonstrate you understand the tradeoffs through your results, not lengthy explanations.
640634

641-
**Format**: Use figures effectively. Quantify everything. Show you understand the tradeoffs, not just "it works."
635+
### 3. Growth Memo
642636

643-
### 3. AI as a Learning Accelerator
637+
Submit a Growth Memo following the standard template at [`03-growth-memo-template.md`](../03-growth-memo-template.md). This is where you reflect on your learning journey, including:
638+
639+
- **Technical skills developed**: What JAX patterns can you now implement?
640+
- **Key challenges & solutions**: What JAX-specific pitfalls did you encounter?
641+
- **AI usage reflection**: How did you use AI tools to understand JAX? What worked? What didn't? How did you verify AI suggestions? This detailed reflection belongs in the Growth Memo, NOT the research memo.
642+
- **Conceptual insights**: How did implementing N-body dynamics in JAX deepen your understanding of functional programming and JIT compilation?
643+
- **What got you excited**: Any "aha" moments with JAX transformations (jit, vmap, grad)?
644+
645+
The Growth Memo is graded pass/fail based on honest, thoughtful reflection. See the template for detailed prompts.
646+
647+
### 4. AI as a Learning Accelerator
644648

645649
Through Projects 1-4, you've demonstrated solid Python expertise. Now it's time to leverage that foundation with modern learning tools. JAX has a sharp learning curve—its functional programming paradigm and compilation constraints are fundamentally different from NumPy. But you have an advantage: **you already understand the underlying physics and computational concepts**.
646650

@@ -655,7 +659,7 @@ Through Projects 1-4, you've demonstrated solid Python expertise. Now it's time
655659

656660
**Critical caveat**: Maintain a **"docs first" mindset**. Check the [JAX documentation](https://jax.readthedocs.io/) and [Equinox API](https://docs.kidger.site/equinox/) before asking AI. Always fact-check AI responses—they're often confident but wrong about version-specific details or edge cases. Use AI to understand concepts and documentation, not as a replacement for understanding.
657661

658-
In your technical report, briefly describe how you used AI tools (if at all): What helped you understand JAX's paradigm? What errors did you learn from? This isn't graded for "correct" AI use—we want honest data to improve the course.
662+
**AI usage reflection belongs in your Growth Memo** (see Deliverable 3 below), not in the research memo. The Growth Memo has dedicated sections for reflecting on AI tool usage, what worked, what didn't, and how your approach evolved.
659663

660664
---
661665

@@ -728,16 +732,17 @@ When something goes wrong (and it will):
728732

729733
## Grading Approach
730734

731-
**Evaluation Method**: Your grade is based on the technical report, quickstart demo, and repository inspection (code reading, not installation).
735+
**Evaluation Method**: Your grade is based on your working validated pipeline (code quality), research memo, quickstart demo, and validation evidence.
732736

733737
| Component | Weight | Evaluation Method |
734738
|-----------|--------|-------------------|
735-
| **Technical Report** | 40% | Quality of analysis, figures, design justification, performance results, validation evidence |
739+
| **Code Quality & Working Pipeline** | 40% | Repository inspection: JAX patterns correct, tests present, clean structure, documentation, functional implementation |
736740
| **Quickstart Demo** | 20% | Does `quickstart.py` run and produce correct physics (energy conservation, $\alpha_{\rm vir} \approx 1$)? |
737-
| **Code Quality** | 25% | Repository inspection: JAX patterns correct, tests present, clean structure, documentation |
738-
| **Validation Evidence** | 15% | Report shows all 6 required tests passed with figures/tables proving correctness |
741+
| **Research Memo** | 20% | Essential validation plots with captions, JAX speedup analysis, design justification |
742+
| **Validation Evidence** | 20% | Memo shows all 6 required tests passed with figures/tables proving correctness |
743+
| **Growth Memo** | Pass/Fail | Honest, thoughtful reflection on learning process (graded separately) |
739744

740-
**Note**: Grading will be based on your quickstart demo output, repository code reading, and comprehensive technical report. I will not be installing your package or running your full test suite—your report must provide convincing evidence that your implementation works correctly.
745+
**Note**: Grading will be based on your quickstart demo output, repository code reading, and research memo. I will not be installing your package or running your full test suite—your memo must provide convincing evidence that your implementation works correctly. The Growth Memo is graded separately as pass/fail.
741746

742747
---
743748

0 commit comments

Comments
 (0)