This repository is a comprehensive educational resource for linear algebra and matrix computations, serving as the companion code for the book "Book 4: The Power of Matrices" from the "Iris Flower Book" series. It contains Jupyter notebooks and Streamlit apps that visualize core concepts from vectors and matrices to eigenvalue decomposition, SVD, and data projections. The code is pedagogical, using synthetic data and the Iris dataset to illustrate mathematical ideas through interactive plots and heatmaps. It is not a production application or data pipeline but a teaching tool. The repository is well-organized by chapter, though code is duplicated across notebooks rather than modularized, reflecting its educational nature.
This repository implements SPECTRA (Supervised discovery of interpretable gene programs from single-cell data), a PyTorch-based library for analyzing single-cell RNA sequencing data. The core functionality involves fitting a model that combines gene expression data with prior knowledge from gene sets to discover biologically interpretable factors. The system takes an AnnData object containing single-cell expression data, cell type annotations, and a gene set dictionary, then learns factors representing gene programs associated with cellular processes. Key features include cell-type specific factor modeling, GPU acceleration options, and multiple optimization approaches (standard gradient descent and EM variants). The codebase demonstrates good software engineering practices with separable components for utility functions, initialization strategies, and eigenvalue-based factor estimation.