Settings

Theme

Fast.ai Part 2: Deep Learning from the Foundations

course.fast.ai

230 points by alohia 6 years ago · 32 comments

Reader

jph00 6 years ago

Nice to see this on the front page! :D There's some more info about the Swift lessons on the TensorFlow blog here: https://medium.com/@tensorflow/3ee7dfb68387

Happy to answer any questions you all might have.

  • epiphanitus 6 years ago

    Been starting your DL course and it's amazing. I love how your approach is both ambitious and practical at the same time.

    You mentioned you studied philosophy as an undergrad. How did you end up working with analytics and DL?

    (I know this is an old thread but I couldn't resist)

yeldarb 6 years ago

I had the pleasure of participating in the synchronous live-stream of the course and loved it.

Looking forward to the release of v2 of the library that was prototyped during the course!

Roadmap: https://forums.fast.ai/t/fastai-v2-roadmap/46661

sanchezdev 6 years ago

I'm excited to see a couple lectures with Swift. All the work to add interoperability with Python and make swift-jupyter is very appreciated and feels like it's Xmas in June.

  • codesushi42 6 years ago

    Why would you need Swift in Jupyter?

    Just implement your model's architecture in Python. Export it. Invoke it at runtime via Swift and TF.

    • erikgaas 6 years ago

      You can but it's not ideal. What if you want to write your own cuda kernel for your experiment? Python isn't really setup for this easily unless you want to throw odd c++ integrations into your code. Swift is designed to be a direct match to the underlying instructions. This would make deep learning much more expressive and flexible in Swift, with less errors.

      This question is addressed extensively in the course. Check out the last two lectures, they do a great job of going over lots of different reasons.

      • codesushi42 6 years ago

        That doesn't really make sense. The code you implement in Swift when in Jupyter needs to also be available at runtime to execute. Meaning you can do the exact same thing in Python, because your model architecture is going to be embedded in the exported model.

        For custom kernel code, what you really want to use is a custom TF op. But I doubt that's what you're getting at anyway, because that's for more advanced use cases.

        • jph00 6 years ago

          The goal is to allow Swift to be used for writing MLIR and XLA kernels. The new LazyTensor under development already allows for fused XLA operations to be created in Swift. There's an awful lot you can do in Swift which is very very hard to do properly in Python. I've got a bit more background on this here: https://www.fast.ai/2019/03/06/fastai-swift/

          Edit: HN isn't letting me reply deeper, so I'll reply to "what are the benefits over C++?" here. The first is that MLIR has dialects that support stuff like polyhedral compilation, which result in much more concise and understandable code, which is often faster too. The second is that using the same language from top to bottom means you can profile/debug/etc your code in one place, which is much more efficient. And you don't have to learn two languages. And you don't have to use C++, which (for me at least) is a big win! ;)

          • codesushi42 6 years ago

            MLIR is going to be orthogonal to C++ performance. You're talking about the efficiency of an intermediate representation. But that IR turns into TF opcodes, which then need to execute natively.

            You can achieve the same efficiency in C++ via a custom TF op. You end up with native instructions either way. And you have access to the entire memmapped model in the op, allowing you to do as you please.

            You're only debugging in one place, because the same C++ code runs during training in your notebook that runs during inference on your device.

            You're getting ease of implementation and usage of Swift. But your code will be less portable; you won't be able to run the same model on Android or on the server. And there's not necessarily any performance benefit over doing the same in C++, definitely not if your kernel is simple.

          • codesushi42 6 years ago

            Thanks. What is the advantage of using Swift over implementing a custom TF op in C++, and using its generated Python wrapper in Jupyter? Just not having to deal with C++?

            • saynay 6 years ago

              Not needing to know both Python and C++.

              If you need to debug something, you don't need to use some mixture of pdb and gdb.

              Swift is a relatively young language, meaning it does not (yet) have weird hairy bits to work around design decisions made 20 years ago.

              Similarly, Swift is still getting defined in many areas. There is (theoretically) the opportunity to influence language design decisions to patterns that mesh better with ML needs.

              This is largely my paraphrasing of the reasons stated by Jeremy https://www.fast.ai/2019/03/06/fastai-swift/

              • codesushi42 6 years ago

                Yes, but at the cost of portability. You won't be able to run the same model on Android for instance.

                You're still debugging in two places; in Swift and Python. Debugging Swift is probably easier than C++ though.

                I think using Swift is a valid solution for special cases, but not the best solution for most cases. The TF authors already provide a suitable, general solution in the form of custom TF ops.

                And if you don't need a custom kernel, and the chances are you don't, then stick with pure Python for maximum ease of use and portability.

rubyfox 6 years ago

Even if you’re not new to DL, I recommend a watch of these - there’s always little bits and pieces in the course which are great little tips, and the part mid-way through where an issue is found with PyTorch layer initializations is v. impressive.

enraged_camel 6 years ago

I've been meaning to learn ML/DL.

My problem is that I can't think of any use cases for it, either in my personal life or work life.

I understand that the technologies have a lot of potential, and are currently used in many major projects and endeavors. I just keep drawing a blank when trying to answer the question, "what would I do with this?"

If I am someone who is goal-driven (rather than, say, learning something for the sake of learning), how can I motivate myself to pick this up?

  • jph00 6 years ago

    You might find it helpful to see what other people are doing with deep learning - see if any of it seems relevant to your interests. For instance, here's some examples of folks from diverse backgrounds using DL in their domains of interest: https://www.fast.ai/2019/02/21/dl-projects/ . Or here's a rather deep rabbit hole - hundreds of replies from people showing their learning projects: https://forums.fast.ai/t/share-your-work-here/27676 .

    I find it useful to think of DL as just another way to get computers to do what you want. Rather than focusing on control flow and setting/reading variables, you focus on providing examples to learn from. Both approaches can do many of the same things, but each has areas that they're better at. Eg DL is better for things that are hard to explain just how you do them (e.g. seeing pictures, hearing sounds, reading text) and traditional coding is better for things that need specific logical steps. A combination of the two is often best for solving end-to-end problems in practice.

  • kevinbird15 6 years ago

    I agree with looking at projects that other people have done. The other thing I would say is: just do part 1 version 3. That will give you a really good idea of what is currently being done in this area and if it isn't interesting to you at that point, you will at least have enough information to know that for sure. Make sure you don't just watch the videos though. You have to actually implement something after each lesson.

  • erikgaas 6 years ago

    Sometimes it is useful to make useless things. It will build experience while being fun and making you more able to come up with "useful" things. Tried this with a friend of mine. Our plan was.

    1. Take webcam at desk. 2. Build model that detects whether he himself is sitting at his desk. 3. If it is not him, you've detected an intruder, so spray the intruder with a squirt gun or something.

    We only got as far as a model that distinguished between him and other people, even deploying it according to this guide. https://course.fast.ai/deployment_render.html

    Also the material is just really interesting. If you want to know how a lot of products work, this is one of the most fun ways to learn.

  • rashkov 6 years ago

    You might come up with use-cases after going through a few of the examples. You know that expression, "when the only tool you have is a hammer, everything looks like a nail"? Well, I think you can use that to your benefit. Once you learn how to swing the hammer of ML/DL, then you'll start seeing nails everywhere.

lelima 6 years ago

I've never used swift before, is much of a difference from python? I like fastai cause was made with python logic.

In the other hand, I'm very exited to try the audio features

dpflan 6 years ago

Can someone who has completed Fast.ai courses comment on the experience and then how you used the newly gained knowledge?

  • kevinbird15 6 years ago

    I have taken all of the fast.ai courses available and they have been life-changing for me. The style of teaching that Jeremy uses really clicks with my learning style (Code then explain) and I have gone from knowing nothing about machine learning to finishing pretty highly on a few different competitions mostly involving NLP and Computer vision. I have been working on Super Resolution more recently and I started working as a Data Scientist at work which has been great. I actually didn't even have a ton of programming experience when I started fastai 3 years ago, but now I am pretty confident when I need to code something. I feel like I have moved through the stages from script-kiddie of data science to a point where I can actually intuitively understand what is happening and trust my instincts to change well-established architectures in ways that it works better for the problem that I am focusing on.

  • erikgaas 6 years ago

    I was lucky enough to participate in the lectures earlier this year. I've watched every fastai course before this and I will continue to watch them, even the introductory material.

    That being said, this course is completely different than anything done before. This course takes a look at the very most basic functionality of neural network libraries and proceeds to implement the fastai library totally from scratch. So it's really a great deep learning + tooling + api design + programming language + research implementation course all in one.

    The last two lectures on Swift were especially fun. Python isn't great for deep learning because you always have to live at arms length from the implementation through a c++ wrapper. Swift can compile straight to the low level system commands. LLVM, MLIR. Still learning this so I'm not the best person to answer questions about this specifically. :)

    So Swift has this awesome feature set of being well designed, pretty similar to Python, statically typed, and low level. These lectures are hosted by Jeremy Howard and Chris Lattner. Sometimes the most valuable learning I can do is to just listen to the banter between two exceptionally experienced experts, so this make the course that much more enjoyable.

    Five starts would recommend. Get the t-shirt.

  • phy6 6 years ago

    I started using the techniques immediately, for applicable deep learning and NLP projects. There's no need to finish the entire course to get some actionable rapid prototyping done. Each lecture is nearly self contained once you're comfortable with the basics.

    • dpflan 6 years ago

      Thanks! Was this for work or personal use?

      • phy6 6 years ago

        Both, as most of my projects are aligned with my personal startup, and other projects are for a salaried startup.

  • bbrian 6 years ago

    The content is very well paced and engaging. The use of Jupyter Notebook really is a great way to demo code. I took Part 1 online (free) and then Part 2 in person ($2000) and feel the money was well spent. TBH, I haven't used it yet, but I enjoyed the classes (they were exciting at times) and I do have a project I'm working towards where I'll use this.

  • ScoutOrgo 6 years ago

    I've gone through all previous iterations of their courses, so have familiarity with using pytorch and the fastai library, but haven't done the best at keeping up with their rapid pace. This course helped me understand the building blocks of the library, which in turn helped me out in a few projects.

    For one project, I adopted what Jeremy taught about building code for processes, which our team has then used for a couple other things as well. For another project, I was able to easily put together the code for training on a set of data with a somewhat complex structure.

jray 6 years ago

Great, thank you so much, Jeremy. One question, will a new version of the Machine learning course be made?

  • jph00 6 years ago

    Not in the short/medium term, at least. The stuff we covered in that Intro to ML course hasn't really changed, so the current course is nearly equally relevant today. (We used the fastai library a little for some basic utility functions, and that bit has changed, but that's not a very important detail.)

pushpendra7 6 years ago

Finally, it's here

tectonic 6 years ago

I did fast.ai last year and it was fantastic.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection