跳到正文
r/MachineLearning· /u/NervousAd5455·· 4 小时前AI 评分56

TrenTorch 上线 1287 道从零实现真实函数签名的练习

Most from scratch ML tutorials implement a simplified version of the function. I wanted the real one. [P]

AI 导读

作者与几位合作者推出 TrenTorch,提供 1287 道从零实现练习,要求写出 torch.nn.functional 暴露的真实函数签名、真实形状与默认值,而非教程里的简化版本。

正文

I kept running into the same thing while learning. You follow a tutorial that says implement cross entropy from scratch. You write four lines. It works on the toy example. Then you open the actual torch source and the real function has ignore_index and label_smoothing and reduction modes, and it handles 2D and 4D inputs, and none of that was in the tutorial.

So you think you understand cross entropy. You don't. You understand a version of it that someone simplified so the blog post would fit on one screen.

I've been building TrenTorch with a few other people, mostly to fix that for myself. It's free. 1287 problems where you implement the real signature, the exact function torch.nn.functional exposes, with the real shapes and the real defaults.

The part that took longest was the testing. Easy to write a test that passes when your code is wrong. So every submit runs a hidden suite. Edge cases. Batch of one. Logits big enough to overflow if you forgot to subtract the max. Gradients checked against finite differences. Some problems are graded against real PyTorch output we generated offline, so if you pass everything your implementation actually matches.

Goes further than I thought it would when we started. 11 modules. Classical ML, then deep learning, transformers, RL, inference, kernels. 290 easy, 502 medium, 245 hard. The hard ones are mostly past where a tutorial would have stopped.

Free and staying free. No subscription, no signup wall on the problems. It runs on one sponsor and donations. Source available on github.

Deep ML exists and is good and I'd point you there too. The difference is depth and the grading. Getting a green checkmark for code that was subtly wrong was the thing that annoyed me most about every other platform I tried.

Would like feedback on the module ordering honestly. Not sure classical ML should come first. Some people want to start at neural nets and I keep going back and forth on whether to let them.

https://TrenTorch.com

submitted by /u/NervousAd5455
[link] [留言]

来源:r/MachineLearning · reddit.com