Latest / Talk Python To Me / #186: 100 Days of Python in a Magical Universe
Transcript
- 0:00The key to making anything a habit, including learning a program, is to make it fun.
- 0:04That's exactly what Annalena Pupkes did with her 100 Days of Code Challenge.
- 0:09She created a magical universe where Python-derived creatures and castles live.
- 0:13Join us on this episode as we explore some of the Python concepts she encountered on her journey,
- 0:18as well as how she made her way to Microsoft Research in the UK, where she's doing an AI residency.
- 0:24This is Talk Python To Me, episode 186, recorded November 13th, 2018.
- 0:30Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities.
- 0:50This is your host, Michael Kennedy.
- 0:52Follow me on Twitter, where I'm @mkennedy.
- 0:54Keep up with the show and listen to past episodes at talkpython.fm, and follow the show on Twitter via at Talk Python.
- 1:00This episode is brought to you by Coder.com and us at Talk Python Training.
- 1:06Annalena, welcome to Talk Python.
- 1:09Hi. Nice to meet you.
- 1:10Nice to meet you, as well. It's so great to have you here.
- 1:12And I'm really looking forward to our topics.
- 1:15We're going to talk about your 100 Days of Code project and its interesting angle.
- 1:19And then a little bit about what you're doing with machine learning as well, because I think that's super interesting.
- 1:25But before we get to the stories, let's start with yours.
- 1:29How did you get into programming in Python?
- 1:30So I got into programming way too late, in my opinion.
- 1:33So I was studying cognitive science in my undergraduate degree in order to become a neuroscientist.
- 1:39And at the very end of the program, I attended an intro to machine learning lecture.
- 1:43And I became so fascinated by the idea that you could have algorithms that are able to learn from data and detect patterns and then even make predictions on data that I decided to switch fields.
- 1:56So I looked for a computer science graduate program that would allow me to focus on machine learning.
- 2:02And of course, I had to start programming.
- 2:05So I looked for a suitable programming language.
- 2:08And when I tried out Python, I knew that it was the perfect choice.
- 2:12So I really liked that it was so easy to get started with, that it has such a nice syntax.
- 2:17And it's, yeah, it's just so readable.
- 2:21Yeah, it's, I think it's very approachable for beginners because it doesn't have all those symbols that look super scary, right?
- 2:26You're like star, star, you know, void, star, star.
- 2:30You're like, whoa, what is this crazy stuff, right?
- 2:32I agree.
- 2:33Yeah.
- 2:34Yeah.
- 2:34And since then, I've been working with Python almost all the time.
- 2:37So it's really nice.
- 2:38Yeah, that's great.
- 2:39I think, I don't know if you were just very smart or very lucky, but having chosen Python is perfect for machine learning, right?
- 2:46I mean, it's exactly where most of the action is these days, right?
- 2:50What other languages were you considering?
- 2:51Oh, that's a good question.
- 2:53I don't even remember.
- 2:54My brain is like a thief sometimes.
- 2:56So I'm sorry for that.
- 2:58I think I did my research and there were quite a, I think I looked into R for a while, which was popular for data science.
- 3:06But Python is just like a general purpose programming language.
- 3:12And I just liked it a lot.
- 3:15So I decided to stick with it.
- 3:16Yeah, I think that's a really great choice.
- 3:19So you were studying cognitive science previously.
- 3:22And then you decided to just jump into programming.
- 3:26How hard was that transition?
- 3:28Really hard?
- 3:29Was it scary?
- 3:30Well, yeah, it was really scary since I started the computer science graduate degree, which is usually not intended for people who have no idea about coding.
- 3:40I would think of a computer science graduate degree.
- 3:45Yes, exactly.
- 3:46So I was lucky that I found a graduate program that you could do without a corresponding undergraduate degree.
- 3:53But in the beginning, I had to do so many things at my classes.
- 3:57And I had all the assignments that required coding, but I had to study the coding part at the same time.
- 4:04So I basically just left out all the classes that weren't using Python and just used the ones such that I could focus on studying one programming language.
- 4:15But it was hard.
- 4:16But it was definitely worth it.
- 4:18So it was the perfect decision for me.
- 4:21I'm really happy right now.
- 4:23Oh, that's awesome.
- 4:23Yeah, and you're doing such cool stuff, which we'll get to in detail later.
- 4:29But I think it's really admirable that you were able to do that.
- 4:32Like you saw what you wanted and you just took a turn.
- 4:36I think there's a real fear when you get really good at something or you're about to get your degree in something or you're even a professional in it to make a change.
- 4:46Because maybe you think you'll like that thing more, but you don't want to give up what you've earned in terms of knowledge.
- 4:53Exactly.
- 4:53It can be quite scary, especially when you spend quite a few years on learning about all the other stuff.
- 5:00So how much does the cognitive science, neuroscience stuff still factor into what you're doing?
- 5:07I think it factors in indirectly sometimes so that I think when I see the algorithms, I sometimes think about, hey, how is that implemented in the brain?
- 5:16Or do we even know whether there is an equivalent thing in the brain?
- 5:21And I still study or read articles on cognitive science since I'm just really fascinated by how the whole power of the way, where the power of the brain comes from and how the brain is working.
- 5:34So, yeah, many machine learning algorithms are actually based on the brain, for example, like neural networks.
- 5:40Right.
- 5:41At least the original ones.
- 5:42Yeah.
- 5:43They've gone a long way since then, right?
- 5:44You've got deep learning models and all that.
- 5:47But it is very similar.
- 5:48You know, I work for my first programming job was at a company that was a startup that was a spinoff from a cognitive science research lab in California.
- 5:59And it was just such a cool place to be there.
- 6:01A bunch of cognitive science PhDs and a couple of programmers.
- 6:05And we were just building fun software to explore and test some of these ideas.
- 6:09And I think cognitive science doesn't get enough credit in terms of how much programming and technology happens there.
- 6:17Yeah.
- 6:17Yeah.
- 6:19It's a very, very fascinating subject.
- 6:22Yeah, it definitely is.
- 6:23So, I remember good times there as well.
- 6:25Okay.
- 6:26So, speaking of machine learning and neural networks, what are you doing today?
- 6:30So, I'm currently at Microsoft Research in Cambridge in the UK.
- 6:34And I'm an artificial intelligence resident.
- 6:37So, that's like an educational program.
- 6:39We're about 20 people.
- 6:41And the overall goal of the program, I would say, is to teach us all the necessary skills to become great research engineers.
- 6:49So, I work on a project that is based on applying Bayesian learning to healthcare data.
- 6:55But, of course, there are lots of projects within Microsoft here in Cambridge that work on lots of different stuff.
- 7:01So, yeah, during the day, I usually try to understand how the algorithms are working and try to figure out the math to actually implement them afterwards.
- 7:10That sounds so interesting.
- 7:12You know, I think I was really surprised to learn about Microsoft Research and how many PhDs they have there and how much research is actually happening at Microsoft Research.
- 7:22So, this lab here in Cambridge is really a research lab.
- 7:26Microsoft does a lot of work on customer projects and so on and products, of course.
- 7:31But this research lab here is about 200, 250 people, of which I think 150 are really working for Microsoft Research in Cambridge.
- 7:43They're always temporary people, interns, and so on.
- 7:47And I think, or I don't know how many of those are really researchers, but there are also, of course, a lot of software engineers and research engineers and maybe about 80 researchers.
- 7:59But that's just a guess.
- 8:00I would have to ask about the number.
- 8:02And that's just Cambridge, right?
- 8:03Yes.
- 8:04Yeah, that's just Cambridge.
- 8:05So, I think I saw a presentation somewhere where they were saying Microsoft has more PhD researchers than Stanford or something insane like that.
- 8:15You know, it's just like –
- 8:16Yeah.
- 8:16It's really –
- 8:17Yeah, they are huge.
- 8:18It's really huge.
- 8:19And so, there's a lot of stuff going on.
- 8:20I'm sure that's a super exciting place to work and AI as well as a big research area.
- 8:25I didn't know that Microsoft was doing so much research in AI before I started the program.
- 8:30So, I was surprised, too, that they were so active and had so many interesting projects going on.
- 8:36Yeah.
- 8:37So, when you were doing your cognitive science stuff before you got into programming, did you see your career, or at least at the moment, being working at Microsoft?
- 8:45No.
- 8:46Not at all.
- 8:48I never thought about myself getting into computer science.
- 8:51That was really so far from what I had planned.
- 8:54Yeah.
- 8:55I think it's really cool, though, that you were able to find your path into it.
- 8:59Yeah.
- 8:59Okay.
- 9:00So, let's talk a little bit about this 100 Days project.
- 9:03I think – you know, I first saw about it because people were talking about it on Reddit.
- 9:08And it was just so – you know, it was such a unique take on it, and people were so excited about it.
- 9:13So, it started out as 100 Days of Code with a Harry Potter theme.
- 9:19But it turned out you had to cancel the Harry Potter part, right?
- 9:22Yes.
- 9:22Regrettably, I had – like, Harry Potter is so heavily copyrighted, and there are so many licenses and so on that it wasn't a safe thing to do to stick to the Harry Potter one and use all the names and places and so on.
- 9:36So, now you have a Harry Potter-inspired 100 Days of Code project.
- 9:40Exactly.
- 9:41Yes.
- 9:42So, I came up with my own little magical universe, which was actually quite a lot of fun, too.
- 9:47I bet it was.
- 9:48Instead of just copying what they got, right?
- 9:49You're like, forget it.
- 9:50I'm going to make my own space.
- 9:51You could spend time on researching names and what they mean.
- 9:55And, yeah, there's so much stuff on the internet.
- 9:58It's amazing.
- 9:59Yeah.
- 10:00That's great.
- 10:01So, let's start with 100 Days of Code.
- 10:03Just what is it?
- 10:05I know some people know it.
- 10:06Many people have probably seen it go by on Twitter because that seems to be where people put all of their – I'm on day 92 and this is what I did, which is great.
- 10:16But maybe they don't know the real history and details.
- 10:19Tell us about it.
- 10:20I think you might be the expert on the real history behind it.
- 10:24But I heard on it on your podcast for the first time.
- 10:27So, that you basically spent 100 days each day on learning about new coding stuff and really spent every day.
- 10:37I think the original one was 30 minutes coding.
- 10:40I adapted it to 15 to fit my needs.
- 10:42Yeah.
- 10:43And, yeah, and then really spent the time, those 100 days, to learn a lot of new cool stuff.
- 10:48I think it's such a cool idea.
- 10:50Just, you know, you're going to spend some time every day.
- 10:54And I think – I don't know if this was conscious as part of it, but I think one of the underlying ideas here is that we often overestimate what we can do in a couple of days or a week.
- 11:05We think we can do a bunch and not really.
- 11:07But we really underestimate what we can do in the long term in three months or six months in a year.
- 11:12You can make way more progress.
- 11:14And I think the underlying idea of 100 days of code is you put in the time and you build the sort of the habit of doing that for over three months.
- 11:25And by the end, you're like, wow, look what I did.
- 11:27Yeah.
- 11:28Yeah, the habit building is a big part of it.
- 11:30Yeah, and you also said when you first started writing about it that there was this sort of no more procrastination thing going on Reddit.
- 11:38What's the story of that?
- 11:39Yeah.
- 11:40So, actually, I had two things that I combined.
- 11:43I found this awesome post called The X Effect on the subreddit that is called Get Disciplined.
- 11:49And it's basically about how you can create a new habit.
- 11:53It's a very easy strategy like that you just have a card and you draw lines on the card such that you get small squares.
- 12:00And then every day that you spend on working on your habit, you can cross out one of the squares with a big fat X.
- 12:10Not a light one.
- 12:12A big fat one that makes it really obvious like you've done it right.
- 12:15So it feels good.
- 12:16Yeah.
- 12:16And it's quite a lot of fun to visually track your progress.
- 12:21Yeah, I'm sure it is.
- 12:22It sounds great.
- 12:23So I'll link to the Get Disciplined post on Reddit.
- 12:26And I didn't know about that subreddit, although I'm interested in it now.
- 12:30That's cool.
- 12:30Yeah, you can find a lot of interesting stuff on it.
- 12:33Yeah, I bet you can.
- 12:34Where were you in your journey into programming and machine learning when you started the 100 Days of Code?
- 12:40I just started an internship at Bosch, the Center of Artificial Intelligence.
- 12:45So I was about, so I had applied a few machine learning algorithms already to data sets and so on.
- 12:52But I had not spent so much time really on Python and all its advanced features.
- 12:57I looked at Dan Bader's book a little bit.
- 13:01I don't remember the name at the moment, but it's a pretty good.
- 13:04Python tricks.
- 13:04Yes, exactly.
- 13:05I can definitely recommend it.
- 13:07But yeah, I wanted to spend a bit more time on Python and all the advanced features.
- 13:12Since I think that with Python, at some point you get to a stage where you feel comfortable and you can write code.
- 13:20But you miss out on all the great features that Python has to offer.
- 13:24So I wanted to bridge that gap somewhat.
- 13:28Yeah, that's cool.
- 13:29I think that's one of the challenges of Python actually is many people learn,
- 13:33just enough to solve their problem.
- 13:36And because it's so simple, you can kind of just learn a little bit and live in that space.
- 13:41But you're not really taking full advantage of everything that's possible, right?
- 13:45I agree.
- 13:46It was the same for me.
- 13:47Yeah.
- 13:48This portion of talk by Python to me is brought to you by Coder.com.
- 13:54Coder.com has really nailed the idea of developer tools in the cloud.
- 13:57Have you heard about how amazing Visual Studio Code is lately?
- 14:01How would you like to have VS Code in the cloud on powerful infrastructure?
- 14:05I don't mean something similar to Visual Studio Code, but the full actual VS Code with built-in collaboration and instant access to massive Linux-based computing resources.
- 14:16Whether you're working on Windows but developing for Linux, running local Linux but need way more computing power, or even if you want to do development on a Chromebook or iPad, Coder.com has a full browser-based instance of VS Code just waiting for you.
- 14:30One annoying thing about cloud-based dev tools is you don't control the platform.
- 14:34You can't install or configure anything.
- 14:37With Coder.com, you get full root access to a Docker container with a gig of RAM and 3 gigs of disk space, and that's just with the free account.
- 14:45On top of that, you have fast time for when you have serious computing to do.
- 14:49You'll get access to 96 CPU cores to crunch that Python code fast.
- 14:53Finally, we know that Google Docs has made online collaboration enjoyable and an important part of many people's daily work.
- 14:59Coder.com brings this type of collaboration to your software projects.
- 15:03That makes them perfect for interviews, teaching, and teamwork.
- 15:07After just a couple of minutes of using Coder.com, you'll forget that you're even using a browser.
- 15:11It's the Visual Studio Code experience you love, just with way more power and available everywhere.
- 15:17Visit talkpython.fm/coder to get started for free.
- 15:21So let's talk about some of the things you covered in your 100 days of code that were...
- 15:28You had a different world you created called Castle Kilmer.
- 15:32Is that right?
- 15:33Yes.
- 15:34Yeah, exactly.
- 15:35Because Hogwarts wasn't an option.
- 15:38So Castle Kilmer.
- 15:40And let's talk about some of the things you created there.
- 15:42So your 100 days of code didn't cover 100 days of the Castle Kilmer characters.
- 15:49It was sort of half-half, right?
- 15:51Yes.
- 15:51So I started out with this magical universe, but I decided that I would stop when I wouldn't find anything else to really look at.
- 16:01Not to keep working on it just because it was there.
- 16:04I really wanted to have blog posts of high quality and interesting things.
- 16:08And there was also so much other stuff I wanted to take a look at, which was not necessarily related to this concept of the magical universe.
- 16:17So I basically split it in half.
- 16:20Yeah, that makes sense.
- 16:21Sometimes it's hard to cram some feature into a program that just doesn't make sense.
- 16:26Yes.
- 16:27Yes.
- 16:28So all of your code is on GitHub.
- 16:30And I'll link to that, right?
- 16:31And you also...
- 16:33Did you blog every day on this?
- 16:34No.
- 16:35I created one blog post for each big concept.
- 16:38So for example, I spent several days on abstract base classes.
- 16:42But of course, I created one blog post about abstract base classes and not several ones for each day.
- 16:48But each big concept or each big thing has its own blog post with details and the examples.
- 16:55And then there's also the full version of the code for each day.
- 16:58Yeah.
- 16:59Okay.
- 16:59Yeah.
- 17:00Very cool.
- 17:00All right.
- 17:01So let's go through a couple of items that are pretty interesting that you covered.
- 17:05that were in the Castle Kilmer world.
- 17:09So you started out with object-oriented programming as one of them.
- 17:13Why were you thinking about that?
- 17:15I had used classes before.
- 17:16And what I wasn't so used to using object-oriented programming.
- 17:21So I really wanted to take advantage of this project and turn it into one that was based on object-oriented programming.
- 17:28So I started looking at the very basics again, which I really liked.
- 17:34It turned out to be a great choice in the end.
- 17:36Yeah.
- 17:36Just looked at what is object-oriented programming.
- 17:39How does it work in Python that you have classes?
- 17:42And what are classes?
- 17:44Namely, that they act as like blueprints for creating objects.
- 17:48And that these classes then define how objects are structured, what attributes they have, what kind of behavior, so what methods, what functionality.
- 17:57And then I started out with my first class since all of the members of my universe or the universe was based on this Castle Kilmer.
- 18:07And I created the first class called Castle Kilmer member.
- 18:12And then I went on to inheritance.
- 18:15All right.
- 18:15So what are some of the ones that you covered in inheritance?
- 18:17Like, so you have this member.
- 18:18This is like anything that can be a human in this world or a character in this world, right?
- 18:23Yeah.
- 18:23It can be any character, like any member of the class.
- 18:26Of course, within the school, you have the students, you have the professors, you have the ghosts, you have lots of other people.
- 18:34And I wanted to have different classes for them.
- 18:37So I created one for the pupils.
- 18:39I created one for the professors and extended the universe over the course of the next days.
- 18:45Yeah.
- 18:45Nice.
- 18:46You even have a ghost.
- 18:47I like it.
- 18:47Yes.
- 18:48Yeah, I do.
- 18:49Of course.
- 18:50Yeah.
- 18:50Of course.
- 18:51You got to, right?
- 18:51And so I think one of the things I like about this is when people are learning programming, it's a real, it's easy to connect with the way the characters fit.
- 19:02But, you know, and if you sort of model it back to Harry Potter and your mind, right, it's pretty easy to think, okay, I can see how we have all these students and all the professors and they're kind of all magicians.
- 19:13And it really does make it pretty approachable to learn objects and classes and inheritance, I think.
- 19:18Yeah, that's why I went for this magical universe.
- 19:21I really wanted to have something that makes it fun for me to sit down every day.
- 19:25And originally the project wasn't even attended to be public.
- 19:29So I really started it for myself and to have a theme that spans through the entire thing and makes everyday fun.
- 19:36And it really was a lot of fun for me.
- 19:39Yeah, I'm sure it was.
- 19:40It looks really interesting.
- 19:41And I still remember back to some of the programs that I first wrote when I was learning programming.
- 19:46And it's the sort of weird ones that you force yourself to do that are not just homework assignments or whatever that really, you know, stand out, right?
- 19:55Yeah.
- 19:55Yeah, for sure.
- 19:56Okay.
- 19:57So another concept that you covered, which I think is still quite confusing to many folks, is different types of methods on classes.
- 20:06So functions on classes are called methods.
- 20:09And then you have instance methods, class methods, static methods.
- 20:12And then we'll even see some more variations, right?
- 20:16So maybe tell people your take on that and maybe what they are.
- 20:21Yeah.
- 20:21So I started out using instance methods most of the time, which I think everyone is using most of the time.
- 20:27Yeah, I agree.
- 20:28And they have this self parameter, at least the self parameter as an input.
- 20:32And when I started out working on the types of class methods, days of code, I really had no idea that there was something else and how it might be useful.
- 20:43So yeah, for the instance methods and the self parameter points towards when you call a method, it points towards an instance of the class or really an actual object.
- 20:53So these instance methods are quite powerful because they can modify both the object state and the class state.
- 21:00And I had my example was that the Castle Kilmear members were able to say something.
- 21:06So they had a say function and then a certain object.
- 21:11So a certain member was able to say a few words.
- 21:14And they'd have to use some of their properties, right?
- 21:16Like their name or other thing or what type they are, right?
- 21:19The professor, whatever says such and such, right?
- 21:23Yes.
- 21:24Yeah, and that's pretty standard.
- 21:25And then you get into class and static methods.
- 21:27And I think the existence of either a class method or a static method makes a lot of sense.
- 21:32But the existence of both is like, wait, why are there two of these?
- 21:36Why are there two ways to do this?
- 21:38Yes, that was also what I thought.
- 21:39Right now, I really like class methods.
- 21:41And I even used a few static methods now at work.
- 21:45And they can be very useful, especially if you want to communicate your intentions when you write your code.
- 21:52And it makes it much more readable.
- 21:54But only, of course, if the other people also know about class methods.
- 21:57Right.
- 21:58What I used class methods for a lot was to create alternative constructors for a class.
- 22:04Yeah, to really create different members of the universe.
- 22:07So what I understood about class methods is that instead of the self parameter, you have the CLS, which points towards the class, not a particular object.
- 22:17So a class method is restricted in some sense that it can only modify class state, but not the object state.
- 22:25So what I had as class methods for, for example, their use as alternative constructors.
- 22:33So I could create lots of different members of the universe without always having to write out all the names and birth years and so on over and over again.
- 22:41Yeah, I think that's a great use of it.
- 22:43And, you know, we don't talk about design patterns and stuff like that in Python as often as other languages.
- 22:48But it's kind of a factory pattern or something like that where you don't have to know how to create the thing.
- 22:55You just say, hey, type, make one of yourself.
- 22:57And it can put all the pieces together.
- 22:59I think that's cool.
- 23:00Yes, I like that a lot.
- 23:00Yeah, I do too.
- 23:02And honestly, with the static methods and class methods, I know the difference.
- 23:07I know the class method has the type available so it can work with it.
- 23:11And the static one doesn't.
- 23:12The class method kind of knows what level it's on in terms of if there's inheritance, which type you've called it on.
- 23:20The static method doesn't necessarily.
- 23:22But beyond that, I honestly don't really know when I would use static over class.
- 23:28I guess if I don't feel like dealing with a class parameter, I'd use static.
- 23:32But I don't have a great recommendation either there.
- 23:35Static methods are a little weird, I guess.
- 23:38But I don't remember the use case now.
- 23:41I had at work for static methods.
- 23:44But I came across a use case and I was like, wow, I can use a static method.
- 23:49I know what it's for.
- 23:50It really makes sense to use it.
- 23:51Yeah.
- 23:52I do find that I like having sometimes you have a class and then you want some functions that, you know, work with it, but they don't work with instances of it.
- 24:02So either having a class or a static method is nice just for the grouping together.
- 24:07It's like all on this thing.
- 24:09Right.
- 24:10So if you import the class, you don't have to also import the functions, for example, to work with it.
- 24:15It's a little more obvious, I think.
- 24:16Yeah.
- 24:16It's good to communicate that it really somewhat is related to the class, even if it's independent in a sense.
- 24:24Yeah.
- 24:24So another interesting thing you covered was some of the magic methods or the Python data model with the repper and the stir and things like that, right?
- 24:35Yes.
- 24:35Of course, I wanted to get a nice representation of my pupils and my professors and so on.
- 24:42So when you print an object, you usually don't get a very useful representation, but you get, I guess, the class name and then the ID, which is basically the memory address, if I'm correct.
- 24:52I looked into the adunder methods you have for that.
- 24:56And there are actually two ones.
- 24:58That was also interesting for me to realize.
- 25:01I had never implemented them myself.
- 25:04And I only learned then that they have different purposes.
- 25:07So one should rather function as a debugging aid for developers.
- 25:13So the output should be as unambiguous as possible.
- 25:16But then there's also the other one where the output should really be readable so that you as a human can read it.
- 25:24Right.
- 25:24So the repper is the more developer debugging side of things.
- 25:28Yes.
- 25:29And the stir is sort of the print curly bracket.
- 25:33What goes in there.
- 25:34Yeah.
- 25:34Yeah.
- 25:35Yeah.
- 25:36Exactly.
- 25:36I think it's definitely interesting.
- 25:38that's a nice trick as well, just for working on Python projects is if you're using a debugger or anything like that, or even, you know, stack trace type stuff.
- 25:48Go and write a specialized repper for your classes.
- 25:52Because if you're like pausing a debugger or you're showing a list, you know, it'll put that information there instead of just this type at that address, this type at that address.
- 26:01It's like, oh, here's the description.
- 26:02And it can really be helpful.
- 26:04And it doesn't take that much time.
- 26:06No.
- 26:06So, yeah, I agree.
- 26:07It's really useful.
- 26:08Yeah.
- 26:09I agree.
- 26:09And with data classes right now, you even get that implemented for you, right?
- 26:15Yeah.
- 26:15I think you do with data classes.
- 26:16That's right.
- 26:17Yeah.
- 26:173.7.
- 26:17Very nice.
- 26:18Data classes are really sort of simplify a lot of the stuff that we're talking about.
- 26:23Yeah, yeah, yeah.
- 26:23Yeah.
- 26:24I like them.
- 26:25Another one that takes a while for people to get.
- 26:28And sometimes I don't know that people ever get to creating their own just because, you know, so we talked about stopping once your problem is solved and not digging all the way.
- 26:36The decorators, right?
- 26:38Those can be kind of mind-blowing, right?
- 26:40Yeah, absolutely.
- 26:41So, it was a big challenge to wrap my head around how they work.
- 26:45And I think I understood how they work now.
- 26:48But, yeah, don't test me on it.
- 26:50No test.
- 26:52But looking at your project, it looks pretty nice.
- 26:54So, in your world, in your Castle Killmere world, you could have characters that say things and then you create a whisper decorator.
- 27:04And if you put the whisper decorator onto that, it'll make it say it more quietly, right?
- 27:08Yes, exactly.
- 27:09Since, of course, there are also the mean people in my universe.
- 27:12They are called the Dark Army.
- 27:14And they have the leader, which is Lord Odin.
- 27:17And when they take over the school, of course, the people are not walking around anymore and just talk to each other and make jokes.
- 27:25But they would only be whispering.
- 27:26So, I had my application for creating a decorator that turns this saying function into a whispering function.
- 27:34But, of course, what is important about decorators, I guess, to understand it, is that they only modify the behavior of the function when you decorate it.
- 27:43They don't really permanently change the function itself.
- 27:46Right.
- 27:47And you've got to put the decorator on.
- 27:49And if you don't, it's not like somehow importing it is going to sort of patch and rewrite all the functions.
- 27:56Yeah.
- 27:56Yes.
- 27:57Yeah.
- 27:58So, with decorators, you've got this sort of, you take a function and its job is to take another function.
- 28:03And then it can add behavior before, after, and then, you know, hopefully at some point call that function.
- 28:11And all of that takes a little bit of interesting juggling with like star args, star star KW args.
- 28:17And I think that's probably why decorators are challenging because you've got to learn the decorators.
- 28:21You've got to learn like some of the closure data capture stuff in there.
- 28:25And you've got to learn all these, how to, you know, juggle star args and star star KW args all at the same time.
- 28:32So, that's all a little bit crazy.
- 28:33But you also talked about not losing the metadata.
- 28:37So, if, you know, there's either a crash or you want to ask what is this function that I'm calling, right?
- 28:44A regular sort of unsophisticated decorator would say the function is the decorator function, not the internal wrapped function, right?
- 28:52So, you also had some work on that.
- 28:55Yeah.
- 28:55So, I only learned about it then, too, that there's actually when you apply a decorator, the metadata of the function is replaced by, for example, the name, the doc string, and so on by the wrapper function.
- 29:08So, when you want to look at the doc string, you don't actually get the doc string off your function anymore.
- 29:13Right.
- 29:13Which is not so nice.
- 29:14You get help on the decorator or something, right?
- 29:16Yeah.
- 29:16Yeah.
- 29:17Which is usually not so useful.
- 29:19So, of course, that's also what I learned during the 100 days of code.
- 29:23There are packages for almost anything.
- 29:26I'm not sure whether there are many things left that haven't been solved or at least there were attempts to solve it.
- 29:32Yeah.
- 29:32So, there's the functools module.
- 29:34And then there is the functools.wrap wrapper that you can apply to the wrapper function.
- 29:41That sounds confusing now.
- 29:43But that carries over the name and the doc string.
- 29:46It's very easy to use.
- 29:47And, yeah, I think it should be, you should use it by default to make sure that you don't lose the information related to your original function.
- 29:56Yeah.
- 29:56That's a really nice touch and, you know, makes it sort of a proper decorator for sure.
- 30:00This portion of Talk Python To Me is brought to you by us.
- 30:06Have you heard that Python is not good for concurrent programming problems?
- 30:10Whoever told you that is living in the past because it's prime time for Python's asynchronous features.
- 30:16With the widespread adoption of async methods and the async and await keywords, Python's ecosystem has a ton of new and exciting frameworks based on async and await.
- 30:26That's why we created a course for anyone who wants to learn all of Python's async capabilities.
- 30:31Async techniques and examples in Python.
- 30:33Just visit talkpython.fm/async and watch the intro video to see if this course is for you.
- 30:39It's only $49 and you own it forever.
- 30:41No subscriptions.
- 30:43And there are discounts for teams as well.
- 30:46You talked earlier about data classes and how there are these sort of simple little containers, but they implement things like the wrapper function.
- 30:55The thing that predates data classes really was named tuples, right?
- 31:00Yeah.
- 31:01So you spent some time on that as well.
- 31:03And I'm a big fan of named tuples because...
- 31:06Me too, yes.
- 31:07They're so much nicer than...
- 31:09What is the third thing in this tuple?
- 31:11Is that the right one?
- 31:13You know, the string representation is not that helpful, right?
- 31:17And also you get confused so easily with like usual normal tuples with assigning the fields with the order.
- 31:24When you have more fields, it gets so confusing.
- 31:27Yeah, it definitely does.
- 31:29So maybe tell us how named tuples appeared in Castle Kilmere.
- 31:34Kilmere.
- 31:35Yeah.
- 31:36So I talked about these dark army members before.
- 31:40And of course, once you switch to the dark side, there's no way back.
- 31:44Either you get killed by the leader or you just stick with it.
- 31:49So that was perfect since tuples are immutable and named tuples are basically an extension of tuples.
- 31:56So I created my dark army member class as a named tuple so that once you create a dark army member, it is definitely going to be a dark army member at all times.
- 32:08That's really cool.
- 32:09I love it.
- 32:10I love it.
- 32:10That's a really creative use of it.
- 32:12Interpretation of the immutability of named tuples.
- 32:16Another area that you covered was abstract base classes.
- 32:21And I feel like that's a pretty advanced topic as well.
- 32:24What did you find to use abstract base classes for in your universe?
- 32:27So, of course, I found a great thing again, namely spells.
- 32:30That was also something I learned that there are actually many different kinds of spells.
- 32:35You have a curse, you have a jinx, you have a hex, you have a charm, a transfiguration, and so on and so on.
- 32:40But all of them are, of course, spells.
- 32:43And abstract base classes are very useful when you have classes that all belong to one base class.
- 32:51And all of these subclasses should implement certain methods from the base class.
- 32:56But you don't want to be able to instantiate this base class itself.
- 33:00So for the spell, each spell should have a name and then an incantation and a certain effect.
- 33:06And I also added a defining features, for example, that a curse should make people suffer or it should harm people.
- 33:13Yeah, it sounds mean, but that's what curses are for, right?
- 33:16That's right.
- 33:17It's a tough world.
- 33:19Yeah.
- 33:20So I had the abstract base class for a spell.
- 33:24And then you flag all the methods that must be implemented by the subclasses with the abstract method decorator, which was nice to know about decorators at that point.
- 33:34Then I had all these different subclasses like curse, transfiguration, and so on.
- 33:41Yeah.
- 33:42And one of the things I think is really powerful about that is when you have regular inheritance, if you had, say, a charm that was derived from a spell, right?
- 33:51There's no normal way to say it has to do its own version of cast and its own version of defining features.
- 33:58But if you make it an abstract base class, you can say those abstract methods.
- 34:01It makes sure that you implement them or you just can't use the charm, right?
- 34:05So that's a really nice way to make that work.
- 34:07Yeah.
- 34:08Yeah.
- 34:08Yeah.
- 34:09I agree.
- 34:09Absolutely.
- 34:10Yeah.
- 34:10That's something I don't see that often in Python, but I do like it.
- 34:14It's very cool.
- 34:14And then you've got to test your universe once you build it, right?
- 34:19Yes.
- 34:19So that was quite nice since I hadn't spent a lot of time on testing.
- 34:23Although that's so important.
- 34:25I just realized it then and now that I'm working at Microsoft, how important it is to really test your code from the beginning and how much it can tell you about your code and really think about,
- 34:37well, how can this function be broken by a user or what kind of silly inputs could you put in there?
- 34:44Yeah.
- 34:46It's all the bad inputs and things you don't check for.
- 34:48It's easy to put in the right number or the right value and go, oh, that worked.
- 34:52But it's everything else, right?
- 34:53And once you created the test, you can always rerun them.
- 34:56So if you completely change your code base and run your tests, you at least can be sure that most of this functionality is still working.
- 35:05Yeah.
- 35:05I think it's great.
- 35:06It's probably a little extra challenging in your day job compared to Castle Kilmer.
- 35:11Yeah.
- 35:11Because machine learning seems kind of hard to understand.
- 35:16It's a little opaque.
- 35:17And it's just hard to think about, I think.
- 35:21Do you find it to be challenging?
- 35:22Yeah, absolutely.
- 35:23But it was also very useful to start looking at it with such a more simple example like My Magical Universe since it got me started with pytest.
- 35:34And right now, I know all the basics of pytest, and I can make sure that I use the more advanced features.
- 35:40And yeah, pytest is just so powerful.
- 35:43I didn't really realize that before.
- 35:45You can do so many things with it.
- 35:48Yeah, it's amazing.
- 35:49Yeah, it really is amazing.
- 35:50It's great.
- 35:50And I think there's a good lesson here in the learn the one thing at a time, right?
- 35:56Learn testing in a simple space where you understand the other stuff, the stuff you're testing.
- 36:00And then you can apply it to things that are more challenging like machine learning.
- 36:04Yeah, absolutely.
- 36:05Yeah, cool.
- 36:05And it was also nice to look at like how to write proper test functions.
- 36:11I think that's also a big part of it.
- 36:13Yeah, I think a lot of times people don't put enough attention to writing proper test functions,
- 36:17and they just throw something together, and then it becomes hard to work with because it didn't get the same attention the other part of your program did.
- 36:25Yes.
- 36:25And then the testing gets hard, and then you stop doing it, and then you have bugs, and it's not good.
- 36:30Yeah.
- 36:32So that pretty much covers the magical universe side of things.
- 36:36But there's a few other areas maybe worth just touching on really quick.
- 36:40One is if Dunder name equals Dunder main, right?
- 36:47That's always confusing, isn't it?
- 36:49Yeah.
- 36:50It was actually one of my favorite blog posts since before that I used that line so many times, but I never thought about what is actually happening here.
- 37:01Yeah.
- 37:01Yeah, yeah.
- 37:02Yeah.
- 37:02And when I started looking at it, I was first so confused, but then I broke it down into individual steps.
- 37:08And right now, when I see it, I really know what is happening, and that is nice.
- 37:12Yeah.
- 37:13I think this is the first place when I first encountered it where I realized that there were, like, special variables or things that were set, like, Dunder name.
- 37:23I'm like, oh, wait, there's a Dunder name?
- 37:25Where does that come from?
- 37:26Yeah.
- 37:26But there's also Dunder file and other stuff, right, that you can, like, oh, there's other things like this that I can, you know, work with if I need them.
- 37:34Yeah, you usually don't know about them if you never, like, took a look at the different things.
- 37:40Yeah, it's pretty cool.
- 37:42So, it's not super hard once you learn, right?
- 37:45Like, if you run the program directly and you print out Dunder name, you'll see main, you know, Dunder main.
- 37:52But if you import it, you'll see whatever the name of the module was, right?
- 37:56And you can kind of work your way through, and it's not super confusing.
- 37:59It's just when you first see it, you don't know where it comes from, right?
- 38:02Yeah, and it looks, for me, it looked quite scary with all these Dunders and the, yeah, I was really confused.
- 38:10What is all this?
- 38:10Why are these symbols back in my Python?
- 38:12What's going on?
- 38:13Yeah, yeah, for sure.
- 38:15I don't know.
- 38:16Some languages have, like, a convention that if a function is called this and you run that module, then it will just run that function.
- 38:26Like, C has its main and C# has a main, a static void main sort of thing.
- 38:33I don't know.
- 38:34Maybe it's worth adding something like that to Python.
- 38:36Because once you learn it, it's fine.
- 38:38But as a beginner, I think it's one of the things that you have to encounter pretty soon that just looks weird and out of place.
- 38:44I agree.
- 38:44Yeah.
- 38:45Yeah.
- 38:45It's used a lot of times, even in the beginning, without knowing what it's actually doing.
- 38:51Yeah.
- 38:51Right.
- 38:52Exactly.
- 38:52Yeah.
- 38:53I think probably the two big confusing starting points are this Thunder name thing and then virtual environments.
- 39:00Right.
- 39:01Both of those can get you right away when you're not really ready to think about them.
- 39:05Yeah.
- 39:06Absolutely.
- 39:07Yeah.
- 39:07And I guess also maybe just underscores, right?
- 39:10You talked a bit about how underscores are serving so many purposes.
- 39:13Yeah.
- 39:14That was also a really nice thing.
- 39:16I really liked spending time on it.
- 39:19Since I think when you don't know about the naming conventions in Python and how to use underscores appropriately and you're used to some different programming language.
- 39:27For example, I came across code once of a colleague that I think he was programming in C before.
- 39:33And he named all the magic, his methods with Dunder name and another double underscore.
- 39:41And I was like, you shouldn't do that in Python.
- 39:44Like, that has a special meaning.
- 39:46That's not good.
- 39:48And he had just no idea about it since he never looked at the different underscore patterns, which can be.
- 39:54Yeah.
- 39:54They are just different sometimes.
- 39:56Yeah.
- 39:56Yeah.
- 39:56There's you have at least five listed here and there maybe are even more.
- 40:02Yeah.
- 40:02There's a lot of different uses for the underscore.
- 40:04So Python is a language without too many symbols, but they love the underscore for sure.
- 40:09They do.
- 40:10Absolutely.
- 40:11That's definitely one that shows up.
- 40:13All right.
- 40:14So, yeah, I think you had a really interesting take on this 100 days of code and I really like how you created your magical universe and that's great.
- 40:22So what are your main takeaways from this whole experience?
- 40:25So one of the main takeaways was that it can be extremely rewarding to share your work with others and get feedback from other people, especially when it's something that can be useful also for other people.
- 40:37And it's really, really, really useful if you directly apply what you learn.
- 40:42So if you learn about decorators, but never try to build your own decorator, you never actually, I think, fully understand what is going on.
- 40:51So that is a really important thing.
- 40:55Yeah.
- 40:55It's one thing to learn something, but if you don't try to use it, at least in programming, it's not going to it's not really going to stick.
- 41:02You're not going to internalize it.
- 41:03Yeah.
- 41:05Were you surprised at how popular your post on Reddit became?
- 41:09Oh, absolutely.
- 41:10Absolutely.
- 41:11I was so surprised.
- 41:12I really just put it up there after, I don't know, maybe I spent a week on it and then I thought, oh, this is just so much fun.
- 41:19Maybe it's also fun for others to learn about the features by using magic.
- 41:23And then so many people liked it so much.
- 41:27It was a great, great experience.
- 41:30Yeah.
- 41:30That must have felt really good to see so many people enjoying it.
- 41:33And it also motivates you to go on and keep working on it.
- 41:36I'm sure you're like, well, now I have to do this.
- 41:39Yes.
- 41:39Do you think it made you a better developer going through this process?
- 41:43Yeah, I think so.
- 41:44So, for example, it introduced me to many advanced concepts.
- 41:48And I think most of them I didn't even know before or I never fully understood them.
- 41:53And now with working in this AI residency, I could apply quite a few of them already.
- 41:59For example, I used abstract base classes, which I never heard of before.
- 42:03Yeah, definitely.
- 42:04It made me a better developer.
- 42:05Yeah.
- 42:06But there's still a long way to go, I guess.
- 42:07There's always a long way to go.
- 42:09It's like an infinite path.
- 42:11But I think you do get to really dig into some of these things that you maybe use, but you don't really worry too much about.
- 42:21Like, I put a little at symbol, then something goes here, and then it works differently.
- 42:25But you don't really think about the decorators and the funk tools and just all the layers.
- 42:30Yeah.
- 42:30But when you've got to write about it and the purpose is to study that, then it's different.
- 42:34Yeah.
- 42:35All right.
- 42:37Well, let's talk a little bit about where you are working now and where you're going.
- 42:42So you're a big fan of machine learning, I can tell.
- 42:45You talked about how you actually changed your career, basically, because of machine learning, which is really great.
- 42:51So you have another cool GitHub project called Machine Learning Basics.
- 42:57Do you want to tell people about that?
- 42:58Yeah.
- 42:59So in general, I really like working on projects that benefit many people or at least have the potential to benefit many people.
- 43:06So I started this machine learning repository when I was preparing for interviews.
- 43:13And when preparing for interviews and machine learning, you usually have to know about the basic machine learning algorithms,
- 43:20like K-Means, which is a clustering algorithm, or linear regression, logistic regression, and so on.
- 43:26But you really have to know how they work.
- 43:29So it won't work if you just use scikit-learn and then the implementation of them.
- 43:36I call this function.
- 43:37I give it these numbers and then magic.
- 43:39Yeah.
- 43:40But that's what many people do, actually.
- 43:42Yeah.
- 43:42I'm sure.
- 43:43Yeah.
- 43:43Yeah.
- 43:44And it's very useful.
- 43:45It can be very useful.
- 43:46But it's also really nice to just understand what's going on.
- 43:50So that was also a project I started just for me when I was preparing.
- 43:54And I created Jupyter Notebooks with first all the theoretical, most important theoretical basics about the algorithms with formulas and so on,
- 44:05and have everything in one consistent notation.
- 44:08And then I implemented them without using any of these scikit-learn methods and so on, but just Python and NumPy.
- 44:15And yeah, when I was applying to these different residency programs and other things, at some point I thought, oh, well, other people are applying too to these programs, so they can probably use that.
- 44:27And it became also way more popular than I ever expected.
- 44:31Yeah.
- 44:32I'm looking at the repository, and it has 2,000, almost 2,600 GitHub stars, 400 forks.
- 44:38I mean, this is really, really cool.
- 44:40And I think, one, I think it's a fantastic way to learn.
- 44:44Two, I think, I don't know, I'll ask you, like, how were people's impressions when they said, well, what do you know about this?
- 44:51Did you share, like, your GitHub account name with them and stuff like that when you applied to jobs?
- 44:57Yes, that's, like, you usually do that.
- 45:00I think when I applied, I didn't even have that.
- 45:04It wasn't even public.
- 45:05So at that point, it didn't help me much.
- 45:08Right now, it would probably help a lot.
- 45:10It probably would, yeah.
- 45:11But it was really just to teach myself how these algorithms worked.
- 45:15And only at that point, I really realized, do I really know how linear regression works?
- 45:20Do I really know how k-means works, like, the underlying structure?
- 45:25It was really, really good to take a detailed look at the algorithms again.
- 45:30Yeah, I'm sure.
- 45:30I think, you know, there's so many machine learning libraries that you can use.
- 45:35But like you said, if you don't know the foundations, you know, you put numbers in, you get numbers out, and you kind of just have to trust them.
- 45:41You can't reason about whether, does this make sense?
- 45:44Is this working right?
- 45:44So I think this is really great.
- 45:47And I'm sure a lot of people out there will be happy to hear about it, be able to use it.
- 45:51Hopefully, yes.
- 45:52Yeah.
- 45:52You seem to have a real knack for creating things that become quickly popular.
- 45:56Yeah, yeah.
- 45:59It seems like that.
- 46:00Yeah, it's nice.
- 46:01It's nice.
- 46:01All right.
- 46:02So maybe we could talk a little bit about the project that you're working on, at least not necessarily the project.
- 46:07It might be not public or anything, but just the general area of machine learning and healthcare.
- 46:14Yeah.
- 46:14So that's basically my main focus or what I want to focus on, namely apply machine learning algorithms to healthcare problems.
- 46:20Since I think there is, yeah, most healthcare applications just promise so many and huge improvements for so many people.
- 46:28There is already, I think, a lot of algorithms on detecting cancer, for example, from images.
- 46:34Yeah.
- 46:34That is quite popular.
- 46:35Yeah, there have been some amazing research projects or research challenges, I guess, around looking at various scans or mammogram type things and automatically detecting cancer.
- 46:48And those machine learning algorithms are getting as good or better than doctors, right?
- 46:53Yes.
- 46:53And with healthcare, the thing is that you have tons of data lying around in the hospitals.
- 46:59It's just amazing how much data they collect without ever using it.
- 47:03It's just lying there.
- 47:05And with machine learning, you can take advantage of it and create great things.
- 47:11I think there's a lot of possible applications there.
- 47:14Yeah, absolutely.
- 47:15I definitely think there are.
- 47:17I think the challenge with healthcare is people are so protective of the privacy, understandably.
- 47:23I wonder if there'll be, you know, there's big healthcare organizations.
- 47:27And within those organizations, they're allowed to share the information with, say, their doctors, the different doctors and specialists.
- 47:34I wonder if there'll be these healthcare organizations who create machine learning algorithms based on only their own data.
- 47:41And it becomes like an advantage of that organization at some point in the future.
- 47:46I'm not sure that's a good thing, but I wonder if that's something that will happen because of the privacy.
- 47:51Yeah.
- 47:51What do you think?
- 47:52I agree.
- 47:53Yeah, that might really happen.
- 47:54It's very good that healthcare data is so heavily protected.
- 47:57But a lot of times people also don't realize how much good you could do with using the data if you have proper rules how to use it.
- 48:08Right.
- 48:08If we could all live 10 years longer or the last 10 years much more healthy, maybe we wouldn't want as much privacy.
- 48:16We might make that trade off.
- 48:17I mean, we'd trade our privacy to Facebook for, you know, a little like, right?
- 48:21Maybe we could live better.
- 48:23We could make better trade offs.
- 48:24I don't know.
- 48:24So your master's thesis was in this area, right?
- 48:28Yeah.
- 48:28So I really liked working on my master's thesis.
- 48:31It was a project together with the German University Hospital and their radiological department.
- 48:37And they said, well, we have tons of radiological reports lying around here.
- 48:41So these reports are whenever a radiologist looks at an image, he has to, in Germany, create a report and write down, I see this, I see that.
- 48:50This has changed from last time.
- 48:52And so on and so on.
- 48:54But he or she doesn't have to write the report.
- 48:57But there has to be another radiologist that checks the report.
- 49:01And this just takes massive amounts of time, which could be used in way more useful ways.
- 49:07So they said that they would like to have some kind of auto-completion for the doctors so that when they write the reports, it would basically complete the sentence or at least make suggestions to speed up the whole process.
- 49:21But of course, it was German data.
- 49:24And I think for English, there's already a lot of stuff there.
- 49:29But in general, the medical language is very complex.
- 49:34So there are a lot of terms for some types of cancers.
- 49:38You have five names that all mean the same thing.
- 49:40Then you have all the synonyms.
- 49:43Sometimes you can write something with a K, sometimes with a C.
- 49:46And it can be really complicated.
- 49:49So I worked on a recurrent neural network for processing these reports and then really using it in the hospital.
- 49:56And right now we are at the stage.
- 49:58It takes quite a while for them to really incorporate it in their system and try it out, evaluate it, so on.
- 50:04But hopefully then it can be used at some point and really be used by the doctors there to save time.
- 50:11I think that's a really meaningful project.
- 50:14That sounds super cool.
- 50:15And it's way more fun to work on projects like that where you can see the end application.
- 50:20Oh, I'm sure it is.
- 50:21Yeah.
- 50:22One of the really sad things is to work on a project and then see nobody uses it.
- 50:25Right.
- 50:26Yeah.
- 50:26That doesn't feel good.
- 50:28I can certainly see as a programmer how much autocomplete helps, right?
- 50:32Like I know as I'm typing, if it just, you know, you type a few characters and it, you know, completes the next 10, it's super helpful.
- 50:39And I don't know if it happens for you, but at least in the States, the Gmail has started autocompleting sentences in the Gmail editor.
- 50:49Oh, that is interesting.
- 50:50No, I've never used it.
- 50:51Yeah.
- 50:51So it actually studies your email chain and then it will propose, you know, maybe the next five or six words in a sentence.
- 51:00So I'll be like, I'm excited to have, and it'll say you on the podcast.
- 51:04I'm like, whoa, you know, and then you just hit tab and it autocompletes it and off it goes.
- 51:12So I think these ideas are starting to make their way into normal life, right?
- 51:18Outside of programming and super structured words.
- 51:21So I think it would have a huge value.
- 51:24Although the danger is if Gmail gets it slightly wrong, whatever, right?
- 51:29You made a silly mistake.
- 51:30We're all used to autocorrect on our phone, messing up stuff.
- 51:32But if it says that for a cancer diagnosis, then that is a whole different type of problem, right?
- 51:38So the stakes are very high.
- 51:39Yes, absolutely.
- 51:40Yes.
- 51:41You would definitely still have the check, I guess, from a different radiologist.
- 51:45Yeah, but just the creation of it much, much more quickly, I think is really powerful.
- 51:49So when you think of the tons of reports they create every day, absolutely.
- 51:53Yeah, you think, you know, a lot of times they're being doctors, but their day-to-day stuff is actually to sit down and write reports, not to go see patients or work with people, right?
- 52:03It's their bog down.
- 52:04I have some friends and neighbors who are doctors and they just talk about the reports and the bureaucracy.
- 52:10And just it's really frustrating to them.
- 52:12Absolutely.
- 52:13Yeah.
- 52:13Okay.
- 52:14So I think, yeah, this just sounds super cool.
- 52:17What else are you interested in studying in machine learning?
- 52:19I think there are way too many things to be interested in.
- 52:21There's so much going on.
- 52:22It's early days, right?
- 52:23It's, you know, the last five years, it feels like machine learning has gone from this science fiction to science, right?
- 52:31Like it really has come into a thing, right?
- 52:33Yeah.
- 52:34It became quite popular.
- 52:35So I really like what we talked about earlier so that you combine cognitive science and machine learning and that you spend more time on that and maybe try to become, learn more about the human brain and use its power to create new machine learning algorithms.
- 52:52I think that's a very, very interesting field.
- 52:55Yeah, absolutely.
- 52:55I think we're just at the beginning and I don't really know where it goes, but it's going to be very interesting.
- 53:02What happens to jobs?
- 53:04What happens to society?
- 53:05What becomes possible?
- 53:06What becomes scary?
- 53:08And so on.
- 53:09Yeah.
- 53:09I guess one thing just in the scary space that I saw recently is apparently China, some either group or the government, I don't remember which, has come up with a way to identify people by their way they walk.
- 53:20Oh, that is scary.
- 53:22Instead of facial recognition, just their gait, the way they walk.
- 53:25Wow.
- 53:25I thought, whoa, that is something, right?
- 53:29Yeah.
- 53:30So, yeah, pretty, pretty crazy.
- 53:32Yeah.
- 53:33I also heard about recently about also that was a company in China that tracked their employees the entire day through cameras and they read your facial expressions.
- 53:43So they would know your mood all the time when you went to the bathroom, when you were at your desk.
- 53:48And then they have this big database of where they save all the information about all the people all the time.
- 53:55And yeah, when I read the article, I was like, oh, I never want to live in China.
- 54:00This is just so scary.
- 54:01There's some amazing stuff in China, but that sounds so scary for sure.
- 54:06I would not want to work at that place at all.
- 54:09Interesting.
- 54:11So I guess, you know, maybe that brings us to sort of my last few questions here is what do you think the big promises of machine learning and AI are?
- 54:19And what do you think the big challenges or dangers are?
- 54:21I think the big promises are that you can make life better for so many people.
- 54:27Like healthcare is just one of the applications where it can hugely improve our daily life.
- 54:32Dangerous and challenges.
- 54:34Like dangerous, I see so many dangers since you can never stop people.
- 54:38There will always be people who want to use AI to do bad things.
- 54:44And since there is such a lot of such big number of projects at the moment going on and governments have different ideas and different ways of treating people, there will also be bad things.
- 54:57Especially when you look at general AI.
- 54:59When you, I think that could be a whole podcast.
- 55:03Yes, it could.
- 55:04Yeah, there's just so much to, you can be scared about there.
- 55:09So maybe define that for folks.
- 55:10Like there's the focused AIs like Alexa or the thing that can say cancer or not cancer by looking at a picture.
- 55:18But what's general AI?
- 55:20Yeah, so there's this difference between general and specific AI, just as you just said.
- 55:24So specific AI means that your artificial intelligence is good at doing one thing, like predicting sentences or speech recognition.
- 55:33But it has just one thing.
- 55:35But we as humans, we have more general AI.
- 55:38We can dance, we can talk, we can like find faces in a crowd and so on.
- 55:44And the idea of general AI is to have more like a human level AI that has all these different kinds of intelligence.
- 55:52So social intelligence, but also that it can perform lots of different tasks equally well.
- 55:59Do you think that will happen?
- 56:00Do you think somebody will come up with it?
- 56:01You think so?
- 56:02I think definitely at some point it will happen because there are too many people who want it to happen.
- 56:07And you can't stop people from researching and working on it.
- 56:11And even if there are people who want to restrict it, there will always be labs who just, I think that's just human nature.
- 56:19Yeah.
- 56:20It has to be solved globally or at least addressed globally, right?
- 56:24Like no one government.
- 56:25It's not like the EU can say, well, we're not doing it.
- 56:27Well, okay.
- 56:28You know, maybe Uruguay is going to become the next place that does, you know, creates it, right?
- 56:33Because they're not subject to the rules and they see it as an advantage.
- 56:35I have no idea about Uruguay.
- 56:37But, you know, just if it's not dealt with on a global level, like it can't even be addressed.
- 56:42But then you have even bad actors amongst places that agree, right?
- 56:46Yeah.
- 56:46Yeah.
- 56:47It's so important that this issue is, becomes more, like people become more aware of how present it is and how important it is to talk about it.
- 56:57And to really understand what is going on and what might happen in the future.
- 57:02So we can start a global discussion on how we want to handle these things.
- 57:06Do you think politicians should discuss these things?
- 57:09Do you think they should be part of like prime minister political debates and things like that?
- 57:13I think they should be a part of it.
- 57:15Yes.
- 57:15But I definitely think that you should talk to the experts most of the time and that they should at least have equal rights in talking about it and making decisions.
- 57:28So it must really be, I guess, representative of all kinds of people.
- 57:33But the experts are those that really understand what can be done and what is currently being worked on.
- 57:40Yeah.
- 57:41So, yeah, I feel like, you know, at least I can speak from the U.S. perspective.
- 57:44I feel like there's a lot of pushback against immigration or outsourcing or other stuff.
- 57:50But I think the reality is a lot of it is the AI and the robots are changing people's jobs and careers much more than any of the other effects that people are arguing and screaming and yelling about, you know?
- 58:01So many people don't realize that, I guess, how much influence AI will have on their jobs.
- 58:06And they just stick to what they're doing right now.
- 58:09And they think, oh, yeah, I can use my smartphone.
- 58:12It's so cool to have Siri and my phone and so on.
- 58:15But they don't think about the long-term changes that will come.
- 58:20Yeah.
- 58:20It's going to be very interesting in all sorts of ways in the next 10, 20 years.
- 58:24I agree.
- 58:25Yeah.
- 58:25Yeah.
- 58:25Interesting.
- 58:26Yeah.
- 58:27I think there's great potential for very much good.
- 58:29And I think there's also a potential for lots of disruption.
- 58:32So it's going to be a mixed bag, but it's going to be interesting to watch it play out for sure.
- 58:37I absolutely agree.
- 58:37And Python and scikit-learn will be at the foundation somewhere, I'm sure.
- 58:40Yeah.
- 58:42Cool.
- 58:43All right.
- 58:44Well, this is a super interesting project.
- 58:47And thanks for sharing your journey with us.
- 58:49It was my pleasure.
- 58:50Yeah.
- 58:50So before you get out of here, though, I got the two questions, final questions for you.
- 58:55When you're writing your Python code, what editor do you use?
- 58:58I use Vim.
- 58:59Vim.
- 58:59Right on.
- 59:00Yeah.
- 59:00My fiance convinced me to start using it about two years ago.
- 59:05And I think I can't switch to anything else anymore.
- 59:07Once you learn something, yeah, it's just tough.
- 59:10Do you also use Jupyter notebooks?
- 59:12Yes.
- 59:13Yes, I do use them.
- 59:14But I get really annoyed with not having all the keyboard shortcuts.
- 59:18I know.
- 59:19So yeah, I usually use them for like most of the time.
- 59:23Yeah, that's cool.
- 59:23And then notable PyPI packages.
- 59:26What ones do you think people should learn about?
- 59:28Yeah.
- 59:29So one I think many people know about already, but it was so useful for me at the point when
- 59:34I started programming was IPDB.
- 59:36So the IPython debugger.
- 59:37It made life so much easier for me.
- 59:40So that I think it's a great package.
- 59:42And then I heard about Black on the podcast a few months ago.
- 59:46I think it was the podcast on coverage, wasn't it?
- 59:49Oh, yes, I think it was.
- 59:50Yeah.
- 59:50Ned Batchelder.
- 59:51Yeah.
- 59:51Yeah.
- 59:51It's a Python code formatter.
- 59:53And I tried it a few times and it looks really, really good.
- 59:56So I will definitely spend more time on learning about Black.
- 59:59Yeah.
- 1:00:00Black is cool.
- 1:00:00There's been linters that will tell you how you formatted your code wrong, but Black goes
- 1:00:05farther and fixes it for you, which is really nice.
- 1:00:08I really like that.
- 1:00:09Yeah, that's cool.
- 1:00:10All right.
- 1:00:11So people are excited about having this magical universe where they can try out their 100 days
- 1:00:17of code and get better at Python and stuff.
- 1:00:18What do you say for them?
- 1:00:20Like what resources you have?
- 1:00:21How should they get started?
- 1:00:22I think the most important thing is just to find a topic that is interesting for yourself
- 1:00:26and that really motivates you to sit down every day and that you make it fun for yourself.
- 1:00:32And that will make it way easier.
- 1:00:34Yeah.
- 1:00:34I think fun is a super key part.
- 1:00:36And I'll link to your blog posts and to your GitHub repository and all that.
- 1:00:40Yeah, please.
- 1:00:40Yeah.
- 1:00:41Yeah, definitely.
- 1:00:41All right.
- 1:00:42Annalena, thank you so much for being on the show.
- 1:00:44It was really interesting and fun to chat with you.
- 1:00:47You too.
- 1:00:48Thank you.
- 1:00:48Bye.
- 1:00:49Bye.
- 1:00:49This has been another episode of Talk Python To Me.
- 1:00:53Our guest on this episode was Annalena Popkas, and it's been brought to you by Coder.com
- 1:00:58and Talk Python Training.
- 1:00:59Coder.com brings full Visual Studio Code and cloud computing to every device.
- 1:01:05Create your free Coder.com account and start collaborating on code today.
- 1:01:09Visit talkpython.fm/coder to create your free account.
- 1:01:13Want to level up your Python?
- 1:01:15If you're just getting started, try my Python jumpstart by building 10 apps or our brand new
- 1:01:20100 days of code in Python.
- 1:01:22And if you're interested in more than one course, be sure to check out the everything bundle.
- 1:01:26It's like a subscription that never expires.
- 1:01:29Be sure to subscribe to the show.
- 1:01:30Open your favorite podcatcher and search for Python.
- 1:01:32We should be right at the top.
- 1:01:34You can also find the iTunes feed at /itunes, Google Play feed at /play, and
- 1:01:39direct RSS feed at /rss on talkpython.fm.
- 1:01:43This is your host, Michael Kennedy.
- 1:01:45Thanks so much for listening.
- 1:01:46I really appreciate it.
- 1:01:48Now get out there and write some Python code.
- 1:01:49I'll see you next time.
- 1:02:10Thank you.