In today’s podcast, we welcome Daniel Voigt Godoy to the show. Daniel is the author of Deep Learning with PyTorch Step-by-Step among other books. We chatted about the following topics: * Favorite Python packages * PyTorch * Book writing * and so much more! Be sure to check out the links section to learn more about Daniel! Links * The binary cross-entropy post: https://towardsdatascience.com/understanding-binary-cross-entropy-log-loss-a-visual-explanation-a3ac6025181a * The PyTorch post: https://medium.com/towards-data-science/understanding-pytorch-with-an-example-a-step-by-step-tutorial-81fc5f8c4e8e * Daniel’s new LLM book: https://leanpub.com/finetuning * Daniel’s books on Amazon Get full access to The Python Show at www.pythonshow.com/subscribe
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
SPEAKER_01Welcome to a brand new episode.
SPEAKER_00Mike Driscoll, The Python Show.
SPEAKER_01Hello, and welcome to The Python Show. I'm your host, Mike Driscoll. And today I'm honored to have a guest. His name is Daniel Godoy, the author of Deep Learning with PyTorch. Anyway, welcome to the show, Daniel.
SPEAKER_00Hi, Mike. Thanks for having me here. Nice to be here.
SPEAKER_01Yeah, it's great to have you. I'd like to ask my guests to give us a little bit of background about yourself. So could you tell us what you do and kind of your journey into programming as well?
SPEAKER_00Yeah, sure. So I'm Brazilian. I was born in Brazil, in Rio de Janeiro, which I think is the most popular Brazilian city in the world. But I moved to the southern part of Brazil when I was really young. I lived there until I was 35. And then I moved to 35, no, 38. And then I moved to Germany in 2015. I spent seven and a half years there. And now I moved again two years ago to Portugal, you know, nicer weather,
SPEAKER_00nicer food, more similar to what I had in Brazil. And over time I had like different careers. I started as a programmer in Brazil. Then for a while I worked for the government. the treasury then when i moved to germany i started my career as a data scientist i attended the boot camp there and i made the transition from programming and a bit of government into data science and after in the beginning of the pandemic i
started writing my series of books so that brought was brought me to a different path in my career right so in then in 2022 i moved countries i moved careers i
SPEAKER_00basically changed everything So that's what I'm at now, right? Mostly focusing on teaching and on writing books and more on the educational part of it all, right?
SPEAKER_01That makes sense. How many books have you written so far?
SPEAKER_00So I started with one big book, but in the end it was 1,100 pages long. So I cannot print that, right? So I had to split it into three volumes. So it was one book, but it became three. Then last year I wrote a book, a sort of self-help book, which is based on my own experience, my journey, switching from a career that I was not enjoying so much to one that I liked better. It kind of tanked, so...
SPEAKER_00And now I'm finishing writing a new book on LLMs, which is like the hot topic of the day, right? So shortly I'll be able to answer five to your question.
SPEAKER_01So do you work in the machine learning space then? Is that why you're working on LLM books?
SPEAKER_00I mean... So I teach a lot, right? So I teach for the Linux Foundation, I teach for the Data Science Retreat, Bootcamp in Germany. The LLM thing, it was something that the founder from DSR in Berlin said, oh, do you want to teach that? Like, okay, cool. Yeah, that's something that I enjoy teaching. So I had to prepare a bunch of material for this. And once you have a class kind of ready from there to go into a book, it's kind of, you know, kind of a no-brainer. So that's why I end up with writing this book.
SPEAKER_01Cool. That's great. I was just curious. Some people I know, all they do all day long is work with LLMs or they create their own models. And I was just curious what your background was.
SPEAKER_02Yeah.
SPEAKER_01Anyway, let's focus a little bit more back on Python. So can you tell us a little bit about your favorite Python packages?
SPEAKER_00So, I mean, in that sense, I kind of biased, right? Because, I mean, I would answer like PyTorch in a way because I think that's what kind of got hooked me into deep learning, right? Because back then I tried a little bit of TensorFlow and Keras. Keras was fine, but TensorFlow was cumbersome back then, like 2018 or so. And then in 2019, I had my... kind of initial experiences with PyTorch. I was attending a summer school that used PyTorch.
SPEAKER_00So I like, okay, I want to go deeper into this. And it really struck me as something that's user-friendly. The API was very nice to use. So that's something that I enjoyed using it. um yeah makes sense also hugging face the hugging face ecosystem i really like working with that right i've been right it's also easier to write about i would say because it's very standardized the way that they have the apis uh you know if you
use one of them one of their packages and then you go to the next you kind of already know what you're where you're standing when it comes to this because
SPEAKER_00they're kind of integrated in a very similar way of interacting with them. And they don't deprecate much stuff, which is always a good sign of things, right? For me, one of the most annoying things, especially when you're developing tutorials and materials to students, is all of a sudden, oh yeah, now we renamed this field. It was this for ages, now it's something else and deprecated the previous one. It didn't have to update all the content and everything breaks. It's like super annoying. But they don't do that, right? So I'm a fan of HuggingFace because of this.
Is HuggingFace completely open source or do they have a page tier as well?
SPEAKER_00I mean, the libraries, you can use everything for free, right? You can upload your models there, data sets there. If you want to do stuff like that's private, right? If you want to run a private model, then you have some quotas that you cannot just go with whatever you have. And then they offer these kind of inference endpoints where you can also pay some fees to serve your models, right? So you can use it.
SPEAKER_01Okay.
SPEAKER_00Kind of an infrastructure of a service, right? Yeah. But if you don't want to, if you just want to experiment, if you want to try it out, you can surely use the free tier and can do pretty much everything.
SPEAKER_01That's cool. I hear that one mentioned off and on from some of my Twitter, I guess it's ex-friends now, the Twitter ex-business. Anyway, a lot of people, a lot of my friends still use Hugging Face and I keep thinking I'm going to try that out someday. Okay.
SPEAKER_00Yeah, I highly recommend that, because I feel like the same thing that I felt when I started using PyTorch, it feels good to use it, right? So you don't feel like you're cumbersome, oh, how is that? It just flows. I don't know. That's the way I feel about it, at least. So do you need to use Pandas with PyTorch, or can you just use PyTorch all by itself? I mean, you don't need Pandas, right? Especially if you're using with Hugging Face, you have this data sense,
SPEAKER_00then you can load CSV files, JSON, all sorts of stuff directly using, and then everything is integrated, right? Nice. So yeah, not using so much Pandas lately.
SPEAKER_01Cool. Good to know. Well, now I'll go ahead and pivot back to books again. Could you just tell us a little bit about how you got into book writing? So that was kind of a funny story, you know, because it was not the main goal in the beginning.
SPEAKER_00It was kind of a long and winding road. At some point, I wanted to, you know, I was considering teaching, having my own boot camp, if you will, right? Because I'm Brazilian, so I always thought maybe we are underserved when it comes to materials in the Portuguese language, right? We have plenty of stuff in English. You can find anything you want, but in Portuguese, not so much. And we have a pretty good pool of developers and programmers in Brazil, right? I think we are very creative in that sense.
But, you know, to make this transition to data science, we really need good materials.
SPEAKER_00And I felt like it was lacking. So I thought, okay, maybe I can try to develop this bootcamp similar to what I attended in Berlin, but in Portuguese. And I started working with that. And so, you know, some of this. And I was talking to a friend and my friend was like, okay, cool. Yeah, I know you. I know that you know your stuff. But who the hell are you, right? He was like, you're nobody. Nobody knows you, you know? Why is anyone going to pay you for this?
SPEAKER_00And then this thing got me thinking, okay, yeah, he's right. Because I didn't have an online presence or anything. And then I was reminded of something that people always used to tell me. Oh, if you want to build an online presence, you need to write something. So you just write a blog post, put it out there. And I'm like, okay, yeah, I need to do that. So I started writing one blog post published in Tomorrow's Data Science in Medium in 2018. I think it was the first.
SPEAKER_00So it got some good reception. And then next year, I was... attending this summer school that used PyTorch. And then my first interaction with PyTorch, I bumped into a few problems, a few issues, because the tutorials were not great. And then when I finished, OK, cool, I'm going to write my own, right? So that's kind of my approach. If I find something that's missing, I don't like what's there, well, I'm going to try to write my own version of it, as if I would like to have found when I started it.
And then I wrote this, understanding PyTorch with a simple example, a step-by-step tutorial.
SPEAKER_00And this was a really popular blog post. Lots of people were like, oh, that's awesome. I really like this tutorial. Thank you for this. And then at some point, I got an email from an acquisition editor from one of the big publishers. oh, do you want to write us a PyTorch 1.x book? I'm like, okay, never wrote a book before.
SPEAKER_00How the hell does that work? And he explained, okay, yeah, we expect a 300-page book. You have six months to write. But then I asked about compensation. It was like $1,500. Yeah. Then I thought, okay, that's not worth it, right? Because you have like 300 pages. I never wrote anything before, so I had no idea how hard that would be. And then six months feels like a compressed timeline. And then you're making peanuts, right?
SPEAKER_00Then I thought, okay, no, no. Thank you very much for the offer, but I'm not taking this. Uh-huh. Yeah. But that got me thinking, you know, okay, maybe I can write a book. Okay, I'll put that on my, like, never-ending to-do list of things, right? And then six months, eight months passed. Nothing happened. And then I remember it was Christmas 2019. I was talking to a friend. And I briefly mentioned this to him. And he was like, oh, you should write a book and self-publish on Amazon.
SPEAKER_00I know this professor at the university that he does that. He makes some peanuts with that. You really should do it. You can write this in a couple of weeks. Yeah, right. I mean, right. But this was like, okay, cool. I really want to do this. But again, procrastination, right? And then pandemic hit. So pandemic in this sense was very useful for me in the sense that, okay, I could not go out to have dinner, you know,
I could not do pretty much of any of the stuff that you like they should do for fun.
SPEAKER_00So I was like at home and with like plenty of time in my hands. Okay, now is finally the time to start writing the book. And then I started. And once I started, well, then it kind of flows, right? So my biggest, I guess everyone's biggest problem is to start the thing. And then I started writing. And then I just wrote and wrote and wrote, like, I don't know, maybe 10, 11 months. So almost a year to write the whole thing. In the end, it was like literally 1,100 pages.
I published this on Limpub because that's one nice thing about Limpub is that you
SPEAKER_00can publish it partially, right? So I was publishing four chapters and then some people, I made a really low price to begin with because it was incomplete, right? And then people would buy it and they'll say, okay, cool, people like that because they're buying. It's not much, but They are buying it, right? So it feels good. It encourages you to keep going. And also, I think that in a way that's when I publish an unfinished book, I'm making a promise to the readers, right? So if you bought something from me,
SPEAKER_00it's kind of like halfway done, I would feel bad about having someone that believed in my work if I would let them down, right? So I felt like I really need to finish this for the sake of the people that supported me in the very early stage. So that really helps you keep going and going until the finish line, especially if it was the first book. So in the end, I had the book. Some people already bought it.
SPEAKER_00It was on Limpa. I'm like, OK, cool, nice. I made not that much money with that, but it was OK. And it was also my first experience. I didn't expect anything from this. And then I procrastinated again because I wanted to make it a paperback version on Amazon. But, you know, that's also a lot of work to convert to the whole thing, to make everything nice, you know, make sure that the margins and everything is set. So it took me almost close to a year also to get this,
SPEAKER_00overcome procrastination and do everything that needs to be done. to publish it on amazon and then i published this in february 2022 yes i think that was it And then it really, well, I would not say it exploded, right? Not like a major thing. But it made it to the bestseller list on Amazon a few times. So that was really, really nice to see. And last year, I was approached by China Machine Press.
SPEAKER_00So they translated my book into Chinese. Which is also something like completely unexpected. Okay, cool. You like my book. And then you wanted to translate the three volumes into Chinese. Okay, cool. Awesome. Count me in, right? Yeah. So now it's also there. Which is, I don't know. It's really, I really like. So you see, that was like, I was aiming for something completely different. And I started writing blog posts. I was approached by someone, you know, so at the end I'm writing. And now I'm, I will not say that's my main activities.
SPEAKER_00I would say that's still teaching, right? But writing books and educational content is like close second. And it's kind of random, right? In my life.
SPEAKER_01Yeah.
SPEAKER_00I will not have foreseen this. Yeah.
SPEAKER_01Yeah, that's cool. I like that. Yeah. What do you feel like are the major things you've learned doing book writing as an author?
SPEAKER_00Yeah, so I think the... The most important, I mean, not the most, one of the hardest part is exactly as I mentioned before, the procrastination part, right? Because if you're self-publishing, self-publishing has one characteristic that's no obligation to anyone else but yourself, right? Which is both good and bad. On the one hand, yay, I don't have to, you know, I can do whatever I want, however I want to have my book.
SPEAKER_00I don't have someone saying, yeah, you cannot do this. Oh, I don't like that. I want to do this different, you know.
SPEAKER_01Yeah.
SPEAKER_00This is freedom is awesome, right? On the other hand, there is no one to, you know, to make me accountable or like you have to do this by that deadline, you know, whatever. So that's why I mentioned that having early people, early readers supporting your work and like paying you, even if it's penis, if it's five bucks, right, already helps you to keep you in line with that. I really like self-publishing. I had some contact with major publishers at some point.
SPEAKER_00Besides that one, I was offered by a different publisher to author a different book, but we couldn't get to an agreement. There was another one that wanted to acquire my books and repackage them. But, you know, but there was some point where the guy said something like, oh, you know, we have to, you know, polish it up and change it. And we need to make, and this kind of really got into my mind, really to make sure that every word has a purpose.
SPEAKER_00And I don't agree with that. Right. Uh, maybe if you're an academic writer, well, then yeah, you want to be concise and precise and all this. Right. But I like my books to be somewhat verbose, if you will. Right. Uh, I, I don't think that the book should be like super dense that you take one hour to, you know, crunch and digest what the content in there in a page. Right. Uh, I want people to read my book and like, oh, awesome.
SPEAKER_00I see that. And then they flow and they go to the next. They want to see what comes next. And then they haven't even noticed and they already read 30 or 50 pages and it just flows, right? So I feel like it should be easy. This is one of the points that I make for the book is to make it easy and enjoyable to read. So I have lots of silly stuff in between, you know, made up quotes, you know, these parodies of movies and these kinds of things that I don't think an editor would ever go for it in a serious book from a major publisher that was,
SPEAKER_00you know, we can have that. And then it's not my book. It's just yet another technical book like any other else, right? I want to make my books mine. So if you read it, you know that was me that wrote that thing because the style is particular, right? Yeah. And I must say that one feedback that I got time and time again is like, oh, I really like that you have this conversational tone, this informal style, right?
SPEAKER_00That the reader feels like he's having a dialogue. He or she is having a dialogue with me, right? Because I throw questions in the book. I try to put myself to the shoe of the reader. And then if I were like a student in a class and I was going to teach that, what would I expect a student to raise their hands and say, what is that? Why are you doing this? And then every time I'll go in the book and I really literally write there.
SPEAKER_00I put a question mark, pretending to be the reader. Why are you doing this? What's the purpose of that? And then I answer it, right? So I think this is something that's, it's not easy to do, but it's something that definitely pays off. And I like writing like this and the readers like it. So yeah, that's a win-win situation, right? I find it really cool that you have a lot of the same philosophies of book writing that I do.
SPEAKER_01So it's fun to listen to.
SPEAKER_02Cool. Awesome. Yeah. Cause I'm like, I started writing because I didn't like the current books out there. I'm like, they didn't cover enough or they didn't cover what I thought was important.
SPEAKER_01And then you've got the, I like the conversational style that I write for my blog, so I put that into my books as well. It's just fun to hear other people say that they do something similar. Nice, yeah. Anyway, so you had mentioned you're working on a new book right now. Could you tell us a little bit about that? Yeah, so this is called The Short Guide to Fine-Tuning LLMs with Pythorch and Huggy Face.
SPEAKER_00Sweet. This was like a consequence of teaching a class on fine-tuning LLMs, right, that I was requested from a friend at the ASAM. And then I was like, okay, I had all the materials. I want to organize into a book. And then again, here I'm also trying to fill a gap that I see. in the wild, right? We have plenty of good books from really good authors already
in the field,
SPEAKER_00but either they focus on the basics, so basically to understand how LLM works on the inside, which is great, right? You need to know that. And we also have, okay, if you have something that you want to put in the real world, that you want to put into production, you also have that, right? What about something in between? Okay, I'm not ready to go into production yet, but I want to do some stuff and I don't have, like, maybe my company or myself, I don't have, like, lots of GPUs,
SPEAKER_00you know, available for me. I only have one that I can get from CoLab or some other cloud provider or you have your own GPU at home. How can you make it work? How can you fine-tune a 400 billion parameters model, but maybe a 7 billion, maybe a 13 billion parameter model? How can you do that yourself without having to spend a lot of money and going through all the steps? So that's why I wanted to cover this middle ground.
SPEAKER_00And then for that, you really need to do a lot of gymnastics with your models and your GPU to make it squeeze the most out of it. So you need to configure a bunch of stuff in the Hugging Face Trainer to squeeze. To make your model take less memory in the GPU RAM and to not use so much memory as you train it, right? To avoid the awful out-of-memory error. Okay. So basically the idea is to explain the concepts that underline to this,
SPEAKER_00like this low-rank adaptation, model quantization. So I go into detail explaining how these things work and why they work. And then the part that's also important is, okay, how can I use these libraries from Hugging Face to configure this in a way that it does what I want it to do? And then really go into detail about the configuration. Say, yeah, if you want to configure this, you need to pay attention to this. And this configuration, it's compatible with that. If you do this at one point, you need to...
SPEAKER_00to do the meshing thing in another place. Because there's so much interconnected points around that you cannot see that in full if you just follow one single tutorial, right? They are too shallow. They don't tell you the consequences of your choices when it comes to configuration, right? Yeah. So that's why I wanted to go over. And then I added something that I would hope to be popular. We only know when it goes live, right?
So I bumped into a bunch of errors when I was trying experimenting with this, right? So basically I collected all sorts of warnings and exceptions that I could possibly get. along the way i collected all of them and i have like okay what what's the message that you get what's the possible cause and how you fix that so i have i have one special chapter just for that just a collection of all warnings and exceptions that you can see right uh so i mean i would i would really have
liked that when i started this so i hope people will enjoy it but you know tricky thing about the
SPEAKER_00writing business is stuff that you think there's going to be Think that you just think that's regular. No one will care. People love it and it goes really popular. So you don't know what's going to go viral or popular in any way, right? So, yeah.
SPEAKER_01Yeah, it's unpredictable. Do you think your new book's going to be another 1,000-page-plus book, or are you trying to keep it shorter?
SPEAKER_00No, no. So it started as a short guide, but then I started writing, okay, once it passed 200 pages, it cannot be short anymore. So I renamed it to a hands-on guide. So I'm still not sure.
SPEAKER_01Okay.
SPEAKER_00But now it's close to finished, right? So I have like a proof copy already from Amazon, you know, doing some final adjustments. So it's 300 pages, 306. So not that long. But I had to cut some stuff off, you know, because the scope kind of grows organically, if you will. You know, I let it develop as I write. So I don't have like a fixed stuff to begin with.
I let it, you know, I have an idea, a general idea of what I want to cover.
SPEAKER_00And then I bump into some part. Oh, okay, cool. I need to explain this. Maybe this requires something else as a background, right? So it kind of multiplies.
SPEAKER_01Yeah, yeah. Yeah, I hear you. I've been there. Yeah. But yeah, I find that the whole process, the process is enjoyable, you know?
SPEAKER_00I like writing. So that's why I like self-publishing as well, right? Because I don't have to commit to a proposal, right? Because if you write a proposal to a publisher, you need to follow that. I mean, I never went through the whole process, right? But I imagine that you can go there. Yeah, you know, I changed my mind. That chapter... I don't want that anymore. I don't think it makes sense. I want to replace it with something else. That guy is going to say, you signed a contract. Now you have to do it, right? And self-publishing gives you the freedom to look in.
SPEAKER_00I don't think this is important anymore. Or I found something super cool that I want to make it to the book. Then you can.
SPEAKER_01Yeah.
SPEAKER_00So I find this extremely important.
SPEAKER_01Yeah, I agree. I do know, I think if you have a really good argument, you can switch it out with a publisher. because I have a friend who's done that, but it's a much more arduous thing to do than it is being a self-published author. You only have to argue with yourself, and you usually win.
SPEAKER_00Exactly. Good and bad, right? You have the freedom to do whatever you want, but also you have to accumulate all the function, right? You have to do everything yourself. I kind of like it, to be honest. I think sometimes I have problems delegating stuff. Yeah. This one, I even made the cover myself. For the Pythorch book, I had someone making the cover. But I had to make it myself. This one, okay, no, no, I'm going to do it from top to bottom.
SPEAKER_00Yeah, it's cool. Yeah, the only thing that I really welcome is, of course, I asked a couple of friends to read my book. at the first for the first part or series of books I had lots of people reading my friends reading it and tell me oh maybe you should explain this better you know so it really helped me for the second one since I already had some some happy readers from the first, first series of books. Some people came up when they came up to me,
when they learned that I was writing a new book.
SPEAKER_00Oh, do you like, do you like me to do an early read? So, you know, I kind of sent a few chapters to some, some people that, volunteer to do it. I got really incredible feedback from all of them. It is so interesting to see that the same text, the same chapter brings different reactions and different suggestions for improvement from different people, right? So people, oh, maybe you can dive deep into this, or maybe you can do something different there.
SPEAKER_00They're never the same, right? So that's... That's super cool, right? Because then it helps me to cover my bases, right? So it's impossible to please everyone. That's a given.
SPEAKER_01Yeah.
SPEAKER_00But still, if you have multiple points of view, giving your feedback, of course, you can make it better to a wider audience, right? which I think, of course, we are all into trying to make it as wide as possible, but not too wide in a sense that if you have someone that's not the target audience for your book and they buy it, they are not going to like it, right? Yeah. So this is actually a concern that I have with this book. Not a concern,
but something I'm being careful about this book is that the first ones were for
SPEAKER_00real beginners, right? So you're like a your first step into deep learning. And this is a harder book to follow, right? So I'm classifying this as an intermediate level book. So if you have gone through the first series of books, awesome. If you have dealt with PyTorch and Huggy Face in the past, cool. But if you have never done anything in deep learning and you get this book, well, then it's going to be super hard, right? Because there is lots of concepts that you need to be aware of to fully understand. profit from this book.
SPEAKER_00And then I tried to make this like as clear as possible, like I'm getting the description in the preface, you know, because I want it.
SPEAKER_02Yeah. You need to know what prerequisites you need to have to go through, right?
SPEAKER_00So that's something that I'm being careful at this time, which I did not have to be concerned about with the one that's like from real beginners, right?
SPEAKER_01Yeah, that makes sense. Cool. So are there any tips you have for people who want to become a writer or a communicator?
SPEAKER_00Yeah, so yeah, that's an interesting question because, you know, some time ago, I got one of my blog posts reached like a million views overall. And it was like mind-boggling. I mean, whoa, one million views, right? So I never thought it would get to this one. And then once that hit me, I was like, okay, cool. What are the key takeaways? What are the lessons that I learned from this, right? Because I kind of started,
SPEAKER_00you know, in a way, improvising, you know, just going as best as I could. And then actually I wrote a short article outlining a few things that, okay, how can you, what did I learn and how can you if you want to join, if you want to follow these steps, what can you do, right? Mm-hmm. And then also, again, I feel like I'm repeating myself, but the main issue is procrastination, right? So if you want to start it, it's really nice to dream about it.
SPEAKER_00Oh, someday I'm going to do that. But, you know, actually doing it is difficult. So how can you mitigate this? How can you overcome that? Two things that I found, right? One is you need to do something that you like, right? So if I were to write about a topic that I don't feel really excited about it, That's not going to fly, right? It's not going to go anywhere. So if you want to start, start with something that you really, really enjoy. And secondly,
SPEAKER_00if you're doing a technical book about programming, right, which is what we're doing here, I would say start coding first. It's always code, for me at least, it's always code first. Because once I write code, I kind of, you know, organize the ideas in my mind, and code is going to tell me which steps I need to follow, and the code is going to tell me when I'm writing it, the parts where I'm feeling some difficulty writing or something that's like I need to,
SPEAKER_00I write it and then I have to fix it and I have to debug it. Well, that's the part that I want to focus on in the writing, right? Because your own learning process is something that you can share with your readers, right?
SPEAKER_02Yeah. So I would say that you're in the best position to teach a beginner when you have
SPEAKER_00just been a beginner yourself. So if you want to, let's say you find a topic that you find it super nice, and then you want to learn a little bit more about it. And as you learn, you take note of stuff, the difficulties you have. And then shortly, you're not going to master it completely, right? But once you feel a little bit confident about what you're doing, well, then start writing. The act of writing itself is going to help you figure out which holes you have in your knowledge still. And it's going to be super helpful for the guy that's coming
right behind you,
SPEAKER_00that's one step behind you in terms of knowledge. Because once you're a master of the whole thing, you're so detached from the basics that you just take them for granted. You cannot even imagine what it was going to be like to be a beginner anymore. So, you know, don't wait until you're a master of something to start writing about it. Start writing right after you learn it and you feel like you're getting somewhere.
SPEAKER_00And share your successes with the people coming behind you. So this is one thing. The other thing is don't try to imitate others in a sense that like... you may have other books where they follow this particular sequence of topics. It is always the same, right? Kind of everyone has a template and they follow the same. Oh, you tell this and then you tell that and then you tell that.
SPEAKER_01Yeah.
SPEAKER_00It doesn't have to be like that. Unless you're like working with a publisher, they're going to force you into something that's like standardized. If you're self-publishing, go wild. Go something, challenge the conventional wisdom, the conventional order where the topic's presented. I mean, maybe it's a bit too much, but I like to think there is some sort of story arc to the book. It has a sequence. And I try to make it in a way that the person learns something, and then these will raise a question in their minds,
SPEAKER_00and then they're going to answer this in the next. And then again, and again, and again. So it kind of feels like a natural progression, which is not how many of textbooks are organized. They're organized like the items, right? So it doesn't work in a flow, right? It's good for reference, sure, but it doesn't work in a flow. So do whatever you feel because there are so many different ways of learning something if you don't need to settle with the standardized one, right?
I like one way of learning and then I'm going to write about it and then there will
SPEAKER_00be an audience for that. There are so many people in the world, there is always an audience for whatever crazy format you want to show your materials. And another thing is, I don't think there is any topic that's too basic. Because this is also something that we often fall for, right? We say, okay, yeah, who's going to want to know about that? This is too basic. There are whole lots of materials about that in the internet. And you know, the blog post that was most popular from all of them,
SPEAKER_00it's almost, now it's 800,000 views already. And if you Google, depends on where you are and stuff, but if you Google binary cross entropy, chances are the first result is mine. which is binary cross-entropy loss, which is like a really basic concept from a loss for classification that you see countless blog posts about it. And then, okay, I'm going to write it because the way that I see it is a bit different from the way that others present. And, I mean, it was popular.
SPEAKER_00People liked it, right? So I charged the conventional ISO and it was well-received and still doing it really well. I even got a couple of times a guy who sent me an email, oh, do you want to sell us the article and sort of change to their blog, change the canonical link? I said, no, no, no. I like mine to be on the top of the result and there is no amount of money that's going to pay for it.
SPEAKER_01Yeah, I ignore emails like that anymore.
SPEAKER_00But it's flattering, right?
SPEAKER_01Yeah, it is.
SPEAKER_00So, yeah, I mean, I think that just a few things that I picked up on my own, and you don't see them, anyone, like, saying, like, usually people follow recipes and templates, right, and go with, like, the same way that everyone else has been doing. So just go different. Try different, right? Yeah. As long as you're having fun, that's okay.
SPEAKER_01Yeah, makes sense to me. So we've talked a lot about technical topics. Maybe we can end the show by you telling us a little bit about your non-technical hobbies, if you have any.
SPEAKER_00It's nice that you have any, right? Well...
SPEAKER_01I had a guest and he didn't have anything. He's just like, well, I like doing these technical things. I play video games. So, you know, it was all tech all the time.
SPEAKER_00I can relate to this to some extent, you know, because I mean, I think I have some non-technical hobbies. For instance, I like a different, wider, different topics, right? So at some, maybe last year when I was writing this other book, which is like a self-help book about career transitioning and handling anxiety, procrastination, I was reading a lot of stuff about psychology, self-help, the way that anxiety works and all these kinds of things.
SPEAKER_00So I wanted to learn for my own benefit and also to share.
SPEAKER_02Yeah.
SPEAKER_00Yeah. But then a couple of months ago, I was attending a course on Latin medieval paleography. So completely different stuff. So this is how you read these weird, crazy scripts from the medieval age where everything looks like an M, this really weird stuff. So I like to try something that's completely out there, completely different. However, every time I try one of those stuff,
my programmer mind comes to the top.
SPEAKER_00How can I automate that? Can I do, you know, read and transcribe this stuff from Latin and medieval Latin automatically? Can I use a Python package for them? How I can organize this? Can I build a data set for it? You know, so the technical part kind of takes over. It tries to take over all the time.
SPEAKER_01Yeah, yeah. I know what you mean. It's really, really hard to dissociate from the mind of a programmer, right?
SPEAKER_00I don't know if that's because I started too early. I started coding when I was eight years old. So just to give it, I'm 48 now, right? So it's 40 years already. I was starting to learn to read and write, and then next year I was already trying to code. Of course, super silly stuff, right? Just copying basic programs from a magazine and stuff and seeing how it would go. But then you learn loops, and then you learn variables, and then you learn programming logic. from an early age, right?
SPEAKER_00And then I can avoid it. Every time I see something now, like, okay, how can I, how do I dissect it into these parts to try to understand, to kind of in my mind to put it into code, right? So kind of a compulsion.
SPEAKER_01Yeah, that makes sense.
SPEAKER_00Do you get many people that with the same behavior here?
SPEAKER_01I feel like that's a common problem with tech guys. We always are like, how do they make this thing work? How do I take apart my computer? It's just the way we're wired, I think.
SPEAKER_00Yeah, that's true. That's very useful, I would say. I managed to solve a lot of problems at work. When I was working for the government, you would not believe the kind of Excel spreadsheets that I saw there. Like terrible, terrible spreadsheets. It's like, hey, no, no, let's redo this. And then I just took over and I just rewrote a bunch of stuff. Even some VBA there, lots of fancy formulas. So, you know,
you feel like a handyman when it comes to tech-related stuff.
SPEAKER_00You know, you just have to fix it.
SPEAKER_01Yeah. Yeah. That's fun. Yeah. Well, I think that brings us to the end of my questions. So I want to thank you so much for being on the show today, Daniel, and hope you'll come on again when you've got a new technical book.
SPEAKER_00Awesome. Thanks a lot. It was really fun to talk about these topics. All the topics that I really enjoy, right? Teaching and coding and writing. So yeah, I had a blast. And yeah, I have one book after that is released. I already have something coming up in the next, which is, if I may, is like I'm calling it provisionally the little book of statistical distributions.
SPEAKER_02Okay.
SPEAKER_00And I want to explain the statistical distribution. character that goes into the world and does some stuff. And he discovers the probability distributions, you know, empirically, which is again, it's completely different kind of take on the subject. Right. And it's kind of in my mind for a while. I need to take it out.
SPEAKER_01Cool. Well, you'll have to tell me about that the next time I see you.
SPEAKER_00Yeah, sure. Happy to.
SPEAKER_01All right. Well, thank you so much again. And we'll talk to you later.
In this episode of the Python Show Podcast, I am pleased to have Tim Hopper as my guest. Tim is the author of the Python Developer Tooling Handbook, a free online resource for everyone. We chat about Python tooling,...
In this episode, we hear from two sisters who put together a beginner's book about Python. The unique hook for their book is that one sister wrote the text while the other did the illustrations. Listen in as we learn...
In this episode, we have special guest Paul Everitt on the show to talk about the new Python Documentary that came our last week. Paul is the head of developer advocacy at JetBrains and a “Python oldster”. We chat about...
In this episode, we have the honor of having Nicolas Rougier on our show. Nicolas is a researcher and team leader at the Institute of Neurodegenerative Diseases (Bordeaux, France). We discuss how Nicolas utilizes...
In this episode, Mike Driscoll talks about his latest book, Creating TUI Applications with Textual and Python. Learn about how and why the book came about, what were some pain points in writing the book and how much fun...