6 ms·
Machine Learning with PyTorch and Scikit-Learn
- p1esk 5y agoone of the big changes is that we transitioned the code example of the deep learning chapters from TensorFlow to PyTorch thank god
- cinntaile 5y agoWhy is that such a big deal?
- macksd 5y agoThis is a pretty good write-up: https://nicodjimenez.github.io/2017/10/08/tensorflow.html https://nicodjimenez.github.io/2017/10/08/tensorflow.html
- hervature 5y agoTensorflow 2 came out in 2019 and so that blog post really does not answer why PyTorch is better than Tensorflow from a technical standpoint. From the author's point of view, it makes clear sense because of the popularity of PyTorch over Tensorflow.
- macksd 5y agoThe general complaints about the API's design and style have not changed so much even with the advent of eager execution by default, etc.
- dr_kiszonka 5y agoFrom the book's Amazon page: "PyTorch is the Pythonic way to learn machine learning, making it easier to learn and simpler to code with. This book explains the essential parts of PyTorch and how to create models using popular libraries, such as PyTorch Lightning and PyTorch Geometric."
- ShamelessC 5y agoI take it you've never had to depend upon a Google library before. Just kidding, but yeah - my understanding is that Tensorflow V1 was annoying to use and that Tensorflow V2 sort of "pytorch-ified" everything but it was a.) breaking changes and b.) too little too late. Now Google has JAX (they JIT numpy so it will run well on their TPU's + autograd) which is coming along nicely and takes a different approach from pytorch. I'll still be using pytorch or a wrapper for pytorch-isms however.
- lgessler 5y agoPyTorch has become the de facto standard for research (meaning cutting edge models often have their sole implementation in PyTorch), and TF has had a much more unstable and uh, baroque API. It should be mentioned that while some of that API mess probably could have been avoided, other parts of it are a consequence of TF's view of computational graphs as static rather than dynamic, which gives it a fundamental performance advantage over PyTorch. (You can think of this as vaguely equivalent to why compiled languages can run faster than interpreted languages.)
- p1esk 5y agofundamental performance advantage over PyTorch It's funny, yes, you could expect that, but in reality TF is almost never faster than Pytorch
- savant_penguin 5y agoA tip for anyone who suffers with the slow training times of the sklearn logistic regression: you can write it with skorch in no time and get _much_ faster training times. I wonder if sklearn will have a pytorch backend one day
- gh02t 5y agoGPyTorch also absolutely crushes the Scikit implementation for Gaussian processes in my experience. Scikit is a treasure, but maybe not my first choice for performance.
- hnnemo 5y agoskorch also supports GPyTorch, see https://skorch.readthedocs.io/en/stable/user/probabilistic.html https://skorch.readthedocs.io/en/stable/user/probabilistic.h... :)
- zetazzed 5y agoConsider also GPU accelerating the whole thing if you have a GPU around. cuML matches the sklearn API https://github.com/rapidsai/cuml/ https://github.com/rapidsai/cuml/. Pays off very quickly if you have large datasets.
- antman 5y agoA drop in replacement for a large part of sklearn for Intel CPUs: https://github.com/intel/scikit-learn-intelex https://github.com/intel/scikit-learn-intelex
- sbbq 5y agoI think Rapids AI's cuML tried to go into this direction (essentially scikit-learn on the GPU): https://docs.rapids.ai/api/cuml/stable/api.html#logistic-regression https://docs.rapids.ai/api/cuml/stable/api.html#logistic-reg.... For some reason it never took really off though. Btw., going on a tangent, you might like Hummingbird (https://github.com/microsoft/hummingbird https://github.com/microsoft/hummingbird). It allows you trained scikit-learn tree-based models to PyTorch. I watched the SciPy talk last year, and it's a super smart & elegant idea.
- exdsq 5y agoHow would one self-study enough about ML to be able to move into an ML engineering role without an academic background on it? Any recommended paths out there?
- bckr 5y agoI corresponded with another user here who accomplished this and wrote about it here[] []http://karlrosaen.com/ml/ http://karlrosaen.com/ml/
- sriram_malhar 5y agoI suggest starting with Andrew Ng's Deep Learning Specialization set of courses. It is a very decent overview.
- kajecounterhack 5y agoI would recommend joining an ML-centric company in an ML infrastructure role, and get real-world experience that way. (Example industries to look at: self driving car companies, spam & abuse departments of major companies, data labeling firms, ML consulting firms). Ideally you want to work with as many ML engineers as you can. Classes and independent study are great, but a lot of these companies want to hire experienced folks for ML roles, so once you have picked up some basics from independent study it's helpful to get an _ML adjacent_ role to help you start moving laterally toward the ML engineer position you want.
- throwaway81523 5y agoThe fast.ai videos are good though very long. Expect to spend a lot of time on the exercises, and you will need an nvidia gpu-equipped computer unless something has changed recently. Those are available as cloud rentals of course though.
- wokwokwok 5y agoDoes anyone buy packt books? I view them as below free-tier content that you a) have to pay for, but since there is basically zero quality control, they're often out of date, full of errors or just either incredibly specific (here's one specific example of a thing) or copy-pasted API documentation. I mean, just seeing packt as a publisher is enough for me to go: I'm not really interested in this. You can make good content and publish it without packt (eg. the FastAI book). If this book is actually good, why did you involve packt? They're the enemy of high quality technical documentation.
- Buttons840 5y agoYes, they aren't that bad. I think your right about them being lower quality than others, but I've seen some good ones. I think an earlier version of this Python ML book was quite good, I remember reading some of it and being happy with it.
- tomrod 5y agoI usually don't, but Raschka's first book was particularly accessible.
- jph00 5y agoThis new book is really good. I don't know why he went with Packt, who do have a lot of low quality titles - but this one is not low quality.
- wodenokoto 5y agoYeah, I also see Packt as a "do not buy"-stamp.
- amval 5y agoI made the mistake of buying one once. It was basically the repacked language documentation without adding anything of value. If they would publish that, the will publish anything.
- elcapitan 5y agoOne thing I noticed a couple of times now is that they just blatantly copy other publishers bestseller titles, probably in the hope of people buying their books accidentally after reading a title recommendation. Example: Hands-On Machine Learning with Scikit-Learn and Tensorflow, O'Reilly, 2017 Hands-On Machine Learning with scikit-learn and Scientific Python Toolkits, Packt, 2020 Really makes me want to filter them out as spam on Amazon etc.
- Mochsner 5y agoMy issue with leaening ML isn't tensorflow, but that I'd need to figure out how to load the models into a mobile device running on C#... Which I have no idea how to do.
- dbish 5y agoOne way to do that for C# is to build your model in PyTorch then transform it to ONNX which Microsoft has a bunch of C# tooling support for: https://docs.microsoft.com/en-us/windows/ai/windows-ml/train-model-pytorch https://docs.microsoft.com/en-us/windows/ai/windows-ml/train.... I am curious though, what mobile device are you trying to run on?
- ShareStories 5y ago
- sriram_malhar 5y agoDoes anyone here have a comparison of this with Trax?
- mark_l_watson 5y agoI didn’t like that this was a Pakt book, but the blog article was so well written and the author bios are impressive, so I just bought it as a Kindle book. Just right now, I am retiring from a lead machine learning job to devote more time to caring for my wife who has some grim health problems. Before that I managed a deep learning team at Capital One. I think that the field of deep learning blows away any other tech right now because it can be used to greatly improve everything else (bio tech, financial tech, medicine, corporate to corporate data communications, optimizing sales, etc., etc.) Anyway, I am glad I dropped by HN this morning, saw this book and bought it. I enjoy going back to basics and relearning things, and I expect to enjoy learning new tools (this book uses PyTorch and SCikit-Learn - I have done 99% of my deep learning work in TensorFlow).