pydatabangalore / talks

Talks at PyData Bangalore meetups
MIT License
36 stars 11 forks source link

Defensive Programming for Deep Learning with Pytorch #27

Closed hsakas closed 4 years ago

hsakas commented 4 years ago

Title

Defensive Programming for Deep Learning with PyTorch

Description

More than often quality production code is ignored in while building deep leading or machine learning models. The proper level of abstractions and building core API will help the entire project shine. To make this happen, Python has a new tool called “typing”. This introduces defining data types and data structures which were previously left to Python and was hard and difficult to debug.

Duration

Audience

Advanced Audience

Outline

Building a High-Level Abstraction

Build modules and using Python ABC module to build high-level abstractions and API.

Defining Data Types and Data Structures

Using the python’s typing module. This module will help build data abstractions at a high level which will be later used by downstream modules. It will help in debugging, readability and in some cases fishing out logical bugs which otherwise will only be possible in runtime.

Error Handling

Error handling even though seems very obvious is missed by most people. It’s always best to imagine a dumb user who will input random or unknown values. Then proceed with that assumptions and build proper Error Handling assert statements. Emphasis should be given on precious msg which instantly will reveal the nature of the error.

Unit Testing

Unit Testing is the most important aspect of the production code, an effective unit test written for a module will not only help identify logics bugs but also help to build a better model. Once this step is done, the top 3 steps have to be repeated again to make everything work seamlessly.

Additional notes

I used to teach Data Science and Machine learning on an online learning platform called Digital Vidya. After that, I do not have any formal experience with public talking but I believe I can manage it.

Currently, I am a Sr. Machine Learning Engineer working toward building scalable solutions to various clients.

Please refer to my GitHub profile for more information on me.

Thanks


NirantK commented 4 years ago

Hey @hsakas, thanks for the talk proposal. Good work on the outline

  1. It'd be great to understand how Typing is relevant to PyTorch model training? I guess if you can add code excerpts, it'd guide us in the right direction.

  2. From the talk outline, it appears that the talk is more about defensive programming for Deep Learning -- and a lot more than Type Hinting. If so, maybe the title should reflect that?

  3. Would you be available for a talk on a. 9th November? b. Sometime 1st week of December?

hsakas commented 4 years ago

Hi, Thanks for getting back to me.

  1. Well, using typing can eliminate a lot of confusion around what kind of tensor or type of tensor is expected inside the model. For example, BoundingBox can be considered as List[Tuple[int, int, int, int]], this will help to get exact specified data type and avoid run-time errors when training the model.

  2. Sound good to me, I can change it as specified.

  3. I am currently not tied up with any major projects and am available on those dates.

vinayak-mehta commented 4 years ago

@hsakas Are you available on Dec 14? https://www.meetup.com/pydata-bangalore/events/266804685/

hsakas commented 4 years ago

Yes I am

vinayak-mehta commented 4 years ago

@hsakas Really sorry for the late reply. Missed your message in the email. We already picked two talks for the Python track. You can give this talk next month if you want :)

hsakas commented 4 years ago

@vinayak-mehta No issues, let me know once you have a spot for a talk.

TrigonaMinima commented 4 years ago

Hey @hsakas we are planning the meetup for 18th Jan. Will you be available for the talk on that day?

hsakas commented 4 years ago

Yes.

TrigonaMinima commented 4 years ago

Great. Putting you on the first slot: 10:30 am to 11:00 am. See you there.

hsakas commented 4 years ago

Thanks!!

TrigonaMinima commented 4 years ago

Hey @hsakas, can you please upload the ppt somewhere on cloud (google docs, google drive, slide share, github) and share the link here? Need to update the readme with the links to the slides.

hsakas commented 4 years ago

Here's the link: https://docs.google.com/presentation/d/1DPWiSbqlR-IVwn7-cx44ZXtr_Rkp0S5v00J_UsadGEg/edit?usp=sharing

Let me know if it works for you. Thanks

TrigonaMinima commented 4 years ago

Yeah, it works. Thanks for the talk. Hope to see you in future talks as well.