TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: ML Library created by Python+NumPy (trains CNNs to a toy GPT-2)

1 点作者 megadragon93 个月前
Hi HN, I built a machine learning library entirely from scratch using only Python and NumPy. I then used it to train a range of models—from classical CNNs, ResNets, RNNs, and LSTMs to modern Transformers and even a toy GPT-2. The motivation came from my curiosity about how to build deep learning models from scratch, like literally from mathematical formulas. I built this project not to replace production-ready libraries like PyTorch or TensorFlow, but to strip away the abstractions and reveal the underlying mathematics of machine learning.<p>Key points:<p>- Everything is derived in code — no opaque black boxes.<p>- API mirrors PyTorch so you can pick it up quickly.<p>- You can train CNNs, RNNs, Transformers, and even GPT models.<p>- Designed more for learning&#x2F;debugging than raw performance.<p>What’s different here?<p>While there are many powerful ML libraries available (TensorFlow, PyTorch, Scikit-learn, etc.), they often hide the underlying math behind layers of abstraction. I believe that to truly master these tools, you first need to understand how they work from the ground up. This project explicitly derives all the mathematical and calculus operations in the code, making it a hands-on resource for deepening the understanding of neural networks and library building :)<p>Check it out:<p>- Github Repository: <a href="https:&#x2F;&#x2F;github.com&#x2F;workofart&#x2F;ml-by-hand">https:&#x2F;&#x2F;github.com&#x2F;workofart&#x2F;ml-by-hand</a><p>- API Documentation: <a href="https:&#x2F;&#x2F;ml-by-hand.readthedocs.io&#x2F;en&#x2F;latest&#x2F;" rel="nofollow">https:&#x2F;&#x2F;ml-by-hand.readthedocs.io&#x2F;en&#x2F;latest&#x2F;</a><p>- Examples: Explore models like GPT-2, CNNs, Transformers, and LSTMs in the examples&#x2F; folder: <a href="https:&#x2F;&#x2F;github.com&#x2F;workofart&#x2F;ml-by-hand&#x2F;tree&#x2F;main&#x2F;examples">https:&#x2F;&#x2F;github.com&#x2F;workofart&#x2F;ml-by-hand&#x2F;tree&#x2F;main&#x2F;examples</a><p>- Blog Post: Read about the project’s motivation, design, and challenges at <a href="https:&#x2F;&#x2F;www.henrypan.com&#x2F;blog&#x2F;2025-02-06-ml-by-hand&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.henrypan.com&#x2F;blog&#x2F;2025-02-06-ml-by-hand&#x2F;</a><p>I’d love to hear any thoughts, questions, or suggestions — thanks for checking it out!

暂无评论

暂无评论