CDE Inference with MAF (Masked Autoregressive Flows)¶
This notebook demonstrates parameter inference using Masked Autoregressive Flows (MAF) from the CDE module. MAF provides a more sophisticated approach to density estimation compared to MDN.
Note
This is a placeholder for the full tutorial. The complete interactive notebook will be available in the examples directory.
Overview¶
MAF vs MDN:
MAF: Uses autoregressive flows for flexible density modeling
MDN: Uses mixture of Gaussians for density approximation
Trade-off: MAF is more expressive but computationally more intensive
Key Advantages:
Expressive: Can model complex, multimodal distributions
Autoregressive: Captures parameter dependencies naturally
Scalable: Efficient for moderate to high-dimensional problems
Tutorial Content¶
The full tutorial demonstrates:
Complex Data Generation: Multi-dimensional nonlinear relationships
MAF Architecture: Configure autoregressive flow layers
Advanced Training: Monitor convergence and performance
3D Visualization: Comprehensive posterior analysis
Robustness Testing: Multiple test cases and evaluation metrics
When to Choose MAF vs MDN¶
Use MAF when:
Complex dependencies between parameters
Multimodal posterior distributions
Higher-dimensional parameter spaces
Need maximum expressiveness
Use MDN when:
Simpler parameter relationships
Faster inference required
Better interpretability needed
Lower computational resources
Performance Comparison¶
The tutorial includes comprehensive comparison:
Accuracy: Posterior approximation quality
Speed: Training and inference time
Robustness: Performance across multiple test cases
Scalability: Behavior with increasing dimensionality
Next Steps¶
Download the complete notebook from examples directory
Apply to real brain models (Jansen-Rit, Wilson-Cowan, etc.)
Compare computational efficiency with SBI methods
Explore different MAF architectures and hyperparameters