[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2749":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":46,"readmeContent":47,"aiSummary":48,"trendingCount":16,"starSnapshotCount":16,"syncStatus":18,"lastSyncTime":49,"discoverSource":50},2749,"numpy-ml","ddbourgin\u002Fnumpy-ml","ddbourgin","Machine learning, in numpy","https:\u002F\u002Fnumpy-ml.readthedocs.io\u002F",null,"Python",16343,3763,452,23,0,1,2,13,3,45,"GNU General Public License v3.0",false,"master",true,[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],"attention","bayesian-inference","gaussian-mixture-models","gaussian-processes","good-turing-smoothing","gradient-boosting","hidden-markov-models","knn","lstm","machine-learning","mfcc","neural-networks","reinforcement-learning","resnet","topic-modeling","vae","wavenet","wgan-gp","word2vec","2026-06-12 02:00:43","# numpy-ml\nEver wish you had an inefficient but somewhat legible collection of machine\nlearning algorithms implemented exclusively in NumPy? No?\n\n## Installation\n\n### For rapid experimentation\nTo use this code as a starting point for ML prototyping \u002F experimentation, just clone the repository, create a new [virtualenv](https:\u002F\u002Fpypi.org\u002Fproject\u002Fvirtualenv\u002F), and start hacking:\n\n```sh\n$ git clone https:\u002F\u002Fgithub.com\u002Fddbourgin\u002Fnumpy-ml.git\n$ cd numpy-ml && virtualenv npml && source npml\u002Fbin\u002Factivate\n$ pip3 install -r requirements-dev.txt\n```\n\n### As a package\nIf you don't plan to modify the source, you can also install numpy-ml as a\nPython package: `pip3 install -u numpy_ml`.\n\nThe reinforcement learning agents train on environments defined in the [OpenAI\ngym](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fgym). To install these alongside numpy-ml, you\ncan use `pip3 install -u 'numpy_ml[rl]'`.\n\n## Documentation\nFor more details on the available models, see the [project documentation](https:\u002F\u002Fnumpy-ml.readthedocs.io\u002F).\n\n## Available models\n\u003Cdetails>\n  \u003Csummary>Click to expand!\u003C\u002Fsummary>\n\n1. **Gaussian mixture model**\n    - EM training\n\n2. **Hidden Markov model**\n    - Viterbi decoding\n    - Likelihood computation\n    - MLE parameter estimation via Baum-Welch\u002Fforward-backward algorithm\n\n3. **Latent Dirichlet allocation** (topic model)\n    - Standard model with MLE parameter estimation via variational EM\n    - Smoothed model with MAP parameter estimation via MCMC\n\n4. **Neural networks**\n    * Layers \u002F Layer-wise ops\n        - Add\n        - Flatten\n        - Multiply\n        - Softmax\n        - Fully-connected\u002FDense\n        - Sparse evolutionary connections\n        - LSTM\n        - Elman-style RNN\n        - Max + average pooling\n        - Dot-product attention\n        - Embedding layer\n        - Restricted Boltzmann machine (w. CD-n training)\n        - 2D deconvolution (w. padding and stride)\n        - 2D convolution (w. padding, dilation, and stride)\n        - 1D convolution (w. padding, dilation, stride, and causality)\n    * Modules\n        - Bidirectional LSTM\n        - ResNet-style residual blocks (identity and convolution)\n        - WaveNet-style residual blocks with dilated causal convolutions\n        - Transformer-style multi-headed scaled dot product attention\n    * Regularizers\n        - Dropout\n    * Normalization\n        - Batch normalization (spatial and temporal)\n        - Layer normalization (spatial and temporal)\n    * Optimizers\n        - SGD w\u002F momentum\n        - AdaGrad\n        - RMSProp\n        - Adam\n    * Learning Rate Schedulers\n        - Constant\n        - Exponential\n        - Noam\u002FTransformer\n        - Dlib scheduler\n    * Weight Initializers\n        - Glorot\u002FXavier uniform and normal\n        - He\u002FKaiming uniform and normal\n        - Standard and truncated normal\n    * Losses\n        - Cross entropy\n        - Squared error\n        - Bernoulli VAE loss\n        - Wasserstein loss with gradient penalty\n        - Noise contrastive estimation loss\n    * Activations\n        - ReLU\n        - Tanh\n        - Affine\n        - Sigmoid\n        - Leaky ReLU\n        - ELU\n        - SELU\n        - GELU\n        - Exponential\n        - Hard Sigmoid\n        - Softplus\n    * Models\n        - Bernoulli variational autoencoder\n        - Wasserstein GAN with gradient penalty\n        - word2vec encoder with skip-gram and CBOW architectures\n    * Utilities\n        - `col2im` (MATLAB port)\n        - `im2col` (MATLAB port)\n        - `conv1D`\n        - `conv2D`\n        - `deconv2D`\n        - `minibatch`\n\n5. **Tree-based models**\n    - Decision trees (CART)\n    - [Bagging] Random forests\n    - [Boosting] Gradient-boosted decision trees\n\n6. **Linear models**\n    - Ridge regression\n    - Logistic regression\n    - Ordinary least squares\n    - Weighted linear regression\n    - Generalized linear model (log, logit, and identity link)\n    - Gaussian naive Bayes classifier\n    - Bayesian linear regression w\u002F conjugate priors\n        - Unknown mean, known variance (Gaussian prior)\n        - Unknown mean, unknown variance (Normal-Gamma \u002F Normal-Inverse-Wishart prior)\n\n7. **n-Gram sequence models**\n    - Maximum likelihood scores\n    - Additive\u002FLidstone smoothing\n    - Simple Good-Turing smoothing\n\n8. **Multi-armed bandit models**\n    - UCB1\n    - LinUCB\n    - Epsilon-greedy\n    - Thompson sampling w\u002F conjugate priors\n        - Beta-Bernoulli sampler\n    - LinUCB\n\n8. **Reinforcement learning models**\n    - Cross-entropy method agent\n    - First visit on-policy Monte Carlo agent\n    - Weighted incremental importance sampling Monte Carlo agent\n    - Expected SARSA agent\n    - TD-0 Q-learning agent\n    - Dyna-Q \u002F Dyna-Q+ with prioritized sweeping\n\n9. **Nonparameteric models**\n    - Nadaraya-Watson kernel regression\n    - k-Nearest neighbors classification and regression\n    - Gaussian process regression\n\n10. **Matrix factorization**\n    - Regularized alternating least-squares\n    - Non-negative matrix factorization\n\n11. **Preprocessing**\n    - Discrete Fourier transform (1D signals)\n    - Discrete cosine transform (type-II) (1D signals)\n    - Bilinear interpolation (2D signals)\n    - Nearest neighbor interpolation (1D and 2D signals)\n    - Autocorrelation (1D signals)\n    - Signal windowing\n    - Text tokenization\n    - Feature hashing\n    - Feature standardization\n    - One-hot encoding \u002F decoding\n    - Huffman coding \u002F decoding\n    - Byte pair encoding \u002F decoding\n    - Term frequency-inverse document frequency (TF-IDF) encoding\n    - MFCC encoding\n\n12. **Utilities**\n    - Similarity kernels\n    - Distance metrics\n    - Priority queue\n    - Ball tree\n    - Discrete sampler\n    - Graph processing and generators\n\u003C\u002Fdetails>\n\n## Contributing\n\nAm I missing your favorite model? Is there something that could be cleaner \u002F\nless confusing? Did I mess something up? Submit a PR! The only requirement is\nthat your models are written with just the [Python standard\nlibrary](https:\u002F\u002Fdocs.python.org\u002F3\u002Flibrary\u002F) and [NumPy](https:\u002F\u002Fwww.numpy.org\u002F). The\n[SciPy library](https:\u002F\u002Fscipy.github.io\u002Fdevdocs\u002F) is also permitted under special\ncircumstances ;)\n\nSee full contributing guidelines [here](.\u002FCONTRIBUTING.md).\n","numpy-ml 是一个完全基于 NumPy 实现的机器学习算法库。该项目提供了多种经典及现代机器学习模型，包括高斯混合模型、隐马尔可夫模型、主题模型（如 LDA）、神经网络及其各种层和模块（例如 LSTM、ResNet 块、WaveNet 块等），以及优化器、正则化技术、损失函数等多种组件。所有实现均采用纯 Python 代码配合 NumPy 库完成，不依赖于任何外部深度学习框架，这使得它非常适合用于教学、研究或快速原型开发中理解底层算法细节。此外，由于其清晰的代码结构和详尽文档支持，对于希望深入了解机器学习算法内部机制的学习者来说尤为适用。","2026-06-11 02:51:07","top_language"]