Latest / Talk Python To Me / #51: SigOpt: Optimizing Everything with Python
Transcript
- 0:00You've heard that machine intelligence is going to transform our lives any day now.
- 0:03This is usually presented in a way that's vague and nondescript.
- 0:07This week, we look at some specific ways machine learning is working for humans.
- 0:11On Talk Python To Me, you'll meet Patrick Hayes, the CTO of SigOpt,
- 0:16whose goal is to accelerate machine learning by optimizing everything.
- 0:19That's a pretty awesome goal.
- 0:21Listen in to this episode and learn all about it.
- 0:24It's episode number 51, recorded March 3rd, 2016.
- 0:29Welcome to Talk Python To Me, a weekly podcast on Python,
- 0:57the language, the libraries, the ecosystem, and the personalities.
- 1:00This is your host, Michael Kennedy.
- 1:02Follow me on Twitter, where I'm @mkennedy.
- 1:04Keep up with the show and listen to past episodes at talkpython.fm,
- 1:08and follow the show on Twitter via at Talk Python.
- 1:10This episode is brought to you by Hired and SnapCI.
- 1:14Thank them for supporting the show on Twitter via at Hired underscore HQ and at Snap underscore CI.
- 1:20A couple of quick updates for you before we get to the interview with Patrick.
- 1:25First, I want to thank all of you who participated in helping me launch Talk Python training through Kickstarter.
- 1:30I finished the course, got the website online.
- 1:32It's training.talkpython.fm, and added all the Kickstarter backers who have filled out the survey to the course.
- 1:38The feedback so far has been really positive.
- 1:40I got this from one student just today.
- 1:42Absolutely loving the course.
- 1:44I learned so much, not just Python principles, but your methodology with designing an app.
- 1:49Your lessons in PyCharm have really helped a ton, too.
- 1:52I've bought so many books and online classes, but nothing has brought it all together like you have.
- 1:56So a big thanks to you, Michael.
- 1:58To celebrate the launch of my course, I'm giving away a free seat to a friend of the show.
- 2:01Just enter your email on talkpython.fm to be eligible to win.
- 2:05I'll draw a winner at the end of the week.
- 2:06Next, I had the honor of telling the story of my career, how I went from super junior,
- 2:11know-nothing developer to developmenter instructor to owning my own business and launching the show.
- 2:16I was on Developer on Fire podcast last week.
- 2:19If you understood these kinds of stories, check out Dave Reel's podcast at developeronfire.com.
- 2:23My episode was 112.
- 2:26Now, let's get to this interview with Patrick.
- 2:28Patrick, welcome to the show.
- 2:30Thanks, Michael.
- 2:30Yeah, it's super exciting you're here.
- 2:32I'm ready to optimize everything.
- 2:34Perfect.
- 2:34That's what we're here for.
- 2:35Very cool.
- 2:36Very cool.
- 2:36Now, before we optimize everything, let's start at the beginning.
- 2:40What's your story?
- 2:41How did you get into programming?
- 2:41Sure.
- 2:42So I started when I was a kid.
- 2:43You know, I was young.
- 2:44My parents' computer played around in Visual Basic or Java or things like that.
- 2:49Kind of just playing around, making little toys myself.
- 2:51They sent me to computer camp at one point, and that's really where I started to get excited about it.
- 2:55Then I went to the University of Waterloo, where I studied computer science.
- 2:58And there, of course, where I got, you know, much better fundamentals and started, you know, to build my career from there.
- 3:03And then I started with Python on one of my first internships.
- 3:06So I was an intern at BlackBerry, and this was probably back in 2007.
- 3:09And at that point, my, you know, programming experience, I was still pretty junior.
- 3:12And I was used to Java and these kind of very verbose languages.
- 3:15And then one of my previous colleagues had written the script in Python, and it was one of my tasks was to update it.
- 3:21So I got in there, and I started playing with it, and I realized, oh, actually, it's Python stuff.
- 3:25Pretty cool.
- 3:25It's much, you know, I can be more expressive, and I can work more quickly.
- 3:28And that's when I started to become a big fan, and I've used it in most of my personal projects since.
- 3:32A lot of people who don't work in Python have this sense that it's kind of like Bash, but you can make websites with it.
- 3:38Right.
- 3:40You know, they don't see the entire sort of landscape of all the amazing stuff you can do.
- 3:47And so a lot of us, when we come to you, you're like, oh, there's a little script I got to maintain.
- 3:51Oh, my goodness.
- 3:52Look, there's this thing called PyPI.
- 3:54And oh, my gosh, look what else you can do.
- 3:55Exactly.
- 3:56That's awesome.
- 3:57Increase in productivity, you know, it was kind of like night and day from what I was used to.
- 4:00So that's definitely.
- 4:01So what did you study in college and work on in BlackBerry?
- 4:04I studied mathematics in university.
- 4:06So I did computer science and also pure mathematics.
- 4:08Yeah, cool.
- 4:09So I went to University of Waterloo.
- 4:10And then while you're at Waterloo, you do six internships.
- 4:12So I was at BlackBerry for my first one.
- 4:15And there I was working on the automated testing team.
- 4:17So, you know, one of the things.
- 4:18Oh, that's a cool.
- 4:19Yeah, it was, you know, I was just getting started kind of with my very first internship.
- 4:22So it was a good way to get my feet wet.
- 4:23I think it's cool that university has the sixth internship.
- 4:26Yeah.
- 4:27Because a lot of times you come out of college and you're like, okay, now what?
- 4:30Yeah, it makes a huge difference.
- 4:32Definitely.
- 4:32I felt that in my career.
- 4:34You know, you graduate and you have six, four month internships.
- 4:36So you basically have almost two full years of work experience at this point.
- 4:40So it's really kind of night and day versus if you hadn't done these internships, what kind of experience, practical experience you have.
- 4:45And it really does complement the education well.
- 4:48Because what you learn in class is very kind of theoretic and good fundamentals.
- 4:52Yeah, it's somewhat detached some of the time.
- 4:54Yeah, exactly.
- 4:55But then when you get into the real, the industry, you're really learning totally different things that you, and you need both to be a good engineer in this day and age.
- 5:01Right, of course.
- 5:01So the company that you guys founded, SigOpt, has machine learning as its sort of central feature that it provides, right?
- 5:11And so could you tell everybody a little bit about just, you know, the mechanics of machine learning and describe how some of the pieces work?
- 5:17Just so, before we get into the details.
- 5:20How machine learning works?
- 5:21Well, yeah.
- 5:21So let's just take a concrete example, right?
- 5:24Suppose I've got some data about a bunch of shoppers and I've got a store and I'd like to optimize something.
- 5:31You know, give me a sort of how you'd go through that with machine learning.
- 5:34Yeah, sure.
- 5:35So a great example, if you have a store, would be you might want to predict fraud.
- 5:38But if you have, you know, much of purchaser, historical purchase data, and maybe you want to minimize the number of fraudulent purchases you receive.
- 5:45Because that's, you know, affects your bottom line.
- 5:46Every kind of, every fraud, fraudulent purchase costs you money.
- 5:49The problem that machine learning can help you solve is, given that you have all this historic data that you've built up over the years, how can you use that to, in the future, make predictions about events you haven't seen yet?
- 5:58So if I've seen a million purchases in the past, I know things about those purchases.
- 6:03Like I know the country that it came from.
- 6:04I know how much money the purchase was for.
- 6:07Whether it was from a sketchy IP address or something like that.
- 6:09And I also know the truth you need to learn from, which was that purchase fraudulent or not.
- 6:14And now you have this data set of past truth, and then you can apply machine learning methods on that data to produce a model that will make predictions in the future.
- 6:22Okay.
- 6:22So basically, as people are checking out, you can ask, hey, should I let this go through, even though the credit card system said yes, right?
- 6:29Exactly.
- 6:29So even though you don't know for sure yet whether it is fraudulent, you can make a guess, a good guess, based on the data you've seen.
- 6:34A good machine learning model, you know, will be accurate, as accurate as possible.
- 6:37You'll always have sort of false negatives and false positives.
- 6:40So, you know, saying a purchase is fraudulent when it might not be, or vice versa, thinking a fraudulent purchase is okay when it is fraudulent.
- 6:46But you want to, of course, minimize that.
- 6:48And a good machine learning model and machine learning process will reduce that.
- 6:50Let's talk about SigOpt a little bit.
- 6:52Your theme or your tagline is to help customers optimize everything.
- 6:57You got it.
- 6:58That's a pretty audacious goal.
- 7:00What is this company you guys founded?
- 7:03So SigOpt is a SaaS optimization platform that helps companies build better machine learning models with less trial and error.
- 7:10So we have an API that exposes the most cutting edge optimization research to our users to help them increase the accuracy of their machine learning models as quickly as possible.
- 7:17So in this example of a fraudulent, a fraud detector, our APIs would help them tune that model to make, to really reduce that, those cases where it would be inaccurate.
- 7:26And we want to get our users to these most accurate models as quickly as possible.
- 7:29We don't want them to spend days or weeks or months trying different possibilities kind of in the dark.
- 7:33All right.
- 7:33That makes sense.
- 7:34It sounds like a big challenge, but it makes sense.
- 7:37So you said you're a SaaS company.
- 7:39Do you actually run the machine learning algorithms?
- 7:42Do you provide like the compute and data processing?
- 7:45Or do you somehow just provide, hey, you should feed these inputs to scikit-learn along with your data?
- 7:54Yeah, that's a great question.
- 7:55The way we help our customers is they have their own models that they're running on their own clusters with their own data.
- 8:01So we're not actually running the models for them.
- 8:03And we're also not looking at any of their sensitive data.
- 8:05What we're doing is we're having our APIs are able to suggest what's the next version of your model you should try.
- 8:12So the models have parameters or variables that affect how well the model works.
- 8:17And finding the best version, the best values for those parameters is a very tough problem.
- 8:21And that's what SIGUP solves in the most efficient way possible.
- 8:23Okay.
- 8:24That's really interesting.
- 8:25Where did this idea for this company come from?
- 8:27Yeah.
- 8:28My co-founder, Scott, he was doing a lot of research on this field during his PhD at Cornell.
- 8:33So he was doing a lot of research in this field and had this great idea for how to build this kind of black box optimizer.
- 8:38That was the beginning of that idea.
- 8:40And we've built the company around it now to put an API around it to make it really easy to use,
- 8:45to administrate all the difficult computation that is required to serve these optimal suggestions.
- 8:51Okay.
- 8:51Do you have some interesting stories around stuff that you've helped people optimize?
- 8:56I heard one of them was something like shaving cream and another was synthetic rhinoceros horns.
- 9:02It's quite varied, right?
- 9:04Exactly correct.
- 9:05So the optimization, so I've been talking about machine learning here, but really it's actually able to optimize.
- 9:10Any problem in which trying something new is very expensive because we want to get you to the best version of your product in as few tries as possible.
- 9:17So that is true for a machine learning model that you have to train it or test it on real user traffic.
- 9:22And that's very expensive.
- 9:23But another thing that's very expensive is these chemical processes.
- 9:26So we have one customer who makes shaving cream and the expensive part for him is he has to go into the lab,
- 9:31mix up his ingredients into a jar or vat or something, wait for 100 hours for it to settle,
- 9:37and then test the quality of the shaving cream.
- 9:39And then based on that, he wants to find a shaving cream that makes him the most profit.
- 9:43So in this case, there's however many ingredients that go in the shaving cream and mixing them in different amounts is a very chaotic process.
- 9:50So as a chemist, he's an expert in his field.
- 9:52So he's able to say, oh, the ranges should probably be somewhere.
- 9:56This acid should probably be between five milliliters and seven milliliters.
- 9:58But then at some point, he gets to this area where the knowledge, he doesn't have as much knowledge as possible about the interactions.
- 10:05So this is where Seagat comes in.
- 10:07Right.
- 10:07It gets down to actual experimentation rather than theory, right?
- 10:11Yeah.
- 10:11Yeah.
- 10:12Trial and error.
- 10:12So now SigOpt, what we're able to do is we're able to model these chaotic effects and are able to suggest,
- 10:17here's the next version of your shaving cream you should try.
- 10:19So then he goes back in the lab, mixes up a batch with what we suggested, tells us how well it did,
- 10:25and then we use that to update our model and give another best suggestion.
- 10:28So before using SigOpt, this chemist had mixed up, you know, 100 different trials just by like keeping track of it in his lab notebook.
- 10:34It hadn't really gotten anywhere.
- 10:35But then he uploaded all his data to SigOpt, and now SigOpt is able to take in that data and analyze it and say, hey, here's what you should try next.
- 10:41And then he did that.
- 10:42And then within just five new batches, he already had a new version of his shaving cream that was 20% more profitable.
- 10:47Wow.
- 10:47That's really cool.
- 10:48And you're modeling physical stuff.
- 10:51It's not just like you're taking in a bunch of data and you're processing it.
- 10:55Like you're helping this guy, you know, make shaving cream.
- 10:58Yeah, exactly.
- 10:58In this case, it's helping with this very physical world problem.
- 11:00And you also mentioned this.
- 11:02You're right.
- 11:02There's another customer using us for synthetic rhinoceros horns.
- 11:05And this is the same thing.
- 11:06It's, you know, they want to make a rhino horn that has these properties, and there's various variables that go into that.
- 11:11Like how much of different chemicals do you use?
- 11:13And we're helping them with that process as well.
- 11:14That's cool.
- 11:14I have to ask.
- 11:15Like, why do they want a synthetic rhinoceros horn?
- 11:17It's a great question.
- 11:18My understanding is there's a large black market for rhinoceros horns.
- 11:21There's two things at play here.
- 11:23One is they want to reduce that black market because they want to stop poaching of rhinos.
- 11:26And one way to do that is to flood the market with these synthetic horns.
- 11:30So right now, you actually, my understanding is you can sell these synthetic horns for a very high price because they mimic the not very expensive real rhino horns.
- 11:37But if you can, but the synthetic ones can be produced at a much larger scale.
- 11:41So now the market's flooded with horns that are identical chemically, but much cheaper to produce.
- 11:45And now it's no longer profitable to actually poach a rhino.
- 11:48That's a really good thing for everyone.
- 11:50That's awesome.
- 11:51What other sort of stories do you have about what you've helped people optimize?
- 11:54Yeah.
- 11:54We also have customers doing synthetic egg whites, music recommendation models.
- 12:00There's really, it's going to be applied across the board on all these very black box, difficult problems.
- 12:05Yeah.
- 12:05Okay.
- 12:05One of the things I think is pretty awesome is some of the stuff at the heart of what you're doing is actually open source software, right?
- 12:12That's correct.
- 12:13Some of the algorithms and whatnot.
- 12:14And yet you're building a business on top of it.
- 12:18And I've talked to a couple of companies lately, a show that's about to come out next week.
- 12:22It's got a really cool sort of story of taking something open source and turn it into a business.
- 12:27And I want to dig into that.
- 12:28But one of the places you guys started was at Y Combinator, right?
- 12:31Yeah, that's correct.
- 12:32What was it like being at YC?
- 12:34It was a lot of fun.
- 12:35It was very kind of exciting, very, definitely a lot of emotions.
- 12:39You have a lot of fun, but you also have a lot of, you know, stress and you have a lot of, you're very busy.
- 12:43You learn a lot.
- 12:44So it was a really fantastic experience.
- 12:45You know, I think it took what me and my co-founder, when we started, you know, didn't really know much of anything about how to build or run a business.
- 12:52And just the three months of the first three months of the Y Combinator, you, it's very transformative.
- 12:57You know what to think about and what not to think about.
- 12:59You know how to stay focused.
- 13:00You know how to talk to users and build something that your customers want.
- 13:04And then it culminates in demo day.
- 13:06And that's when you present to a bunch of angel investors.
- 13:08And that's when it really starts your company from there, getting the fundraising you need.
- 13:11So it definitely makes a huge difference.
- 13:13We definitely wouldn't be where we are today if we hadn't gone through Y Combinator.
- 13:15That's awesome.
- 13:16So how do you actually get into Y Combinator?
- 13:19Is there like a call for applications?
- 13:21Yep.
- 13:22Are there like open demos?
- 13:23Like what's the story?
- 13:24Like how would someone out there is listening?
- 13:26Like I want to be part of Y Combinator.
- 13:27What do they do?
- 13:28They may have changed it a little bit since I did it.
- 13:30So this was I applied in 2014.
- 13:32But essentially, yeah, twice a year they have an open call for applications.
- 13:35And they say, what are you building?
- 13:37Who are you building with?
- 13:39Send us an application.
- 13:40They ask you, do you have any customers?
- 13:42Do you have any traction?
- 13:42Do you have any revenue?
- 13:44What have you built so far?
- 13:45And then they also ask a lot of questions about you as the founders.
- 13:48They ask, what have you built in the past?
- 13:49Where have you worked?
- 13:51One of the kind of notable questions they ask is, what's a system you've hacked in the past?
- 13:55So not hacking in the kind of infiltrating server sense, but like what's the kind of creative thing you've did in the past to skirt around some, I shouldn't say rules, but not like breaking the rules, but doing something clever or creative in the past.
- 14:07Yeah, that's really cool.
- 14:08Would you recommend other people go in there and try it?
- 14:11Like you found it to be a pretty positive experience?
- 14:12Yeah, I would say it was positive.
- 14:13And I mean, I can't say I can recommend it for everyone.
- 14:15I don't know everyone's specific situation, but I would recommend it definitely.
- 14:19It really did take, yeah, me and my co-founder from a state of no experience to, you know, competent at building a company in a very short time.
- 14:31Yeah, I think one of the challenges of starting a company, especially technical companies, the founders, they're technical, right?
- 14:38And part of starting a company, especially one like yours that is a highly technical science, math sort of company requires that.
- 14:46But that's not enough for like user growth and business deals and marketing and growth hacking and connections.
- 14:56Absolutely.
- 14:57That's a real big challenge.
- 14:58And YC helps with that, right?
- 14:59So both me and my co-founder were technical co-founders.
- 15:03So we had to pick up a lot of skills that we had no experience with.
- 15:06What I commonly say is before working at Stigop, my last job, I got to work on what I was good at every day.
- 15:10I was an engineer and I worked on engineering problems.
- 15:12Now as a co-founder, I work on things I'm bad at every day, which is very different.
- 15:16You're spending more time, you know, trying to get customers or build a company or think about culture or think about hiring or think about marketing or think about sales.
- 15:23All these things that I had no experience with prior to starting the company.
- 15:27So you definitely get a lot of experience with these things.
- 15:30Yeah, exposure to totally new things, which as you're right, are essential to running a successful business.
- 15:34But you kind of have to learn it on the fly.
- 15:36So Y Combinator, they do prepare you for this.
- 15:38Also, the network is really, really helpful.
- 15:40So there's probably over a thousand people in the Y Combinator network at this point, you know, past founders.
- 15:46And it's very friendly and welcoming community.
- 15:48You can message them if you have any advice or you have questions or things like that.
- 15:53Oh, yeah.
- 15:53That sounds super helpful.
- 16:05This episode is brought to you by Hired.
- 16:08Hired is a two-sided, curated marketplace that connects the world's knowledge workers to the best opportunities.
- 16:14Each offer you receive has salary and equity presented right up front, and you can view the offers to accept or reject them before you even talk to the company.
- 16:24Typically, candidates receive five or more offers in just the first week, and there are no obligations, ever.
- 16:30Sounds pretty awesome, doesn't it?
- 16:32Well, did I mention there's a signing bonus?
- 16:34Everyone who accepts a job from Hired gets a $2,000 signing bonus.
- 16:38And as Talk Python listeners, it gets way sweeter.
- 16:42Use the link Hired.com slash Talk Python To Me, and Hired will double the signing bonus to $4,000.
- 16:50Opportunity's knocking.
- 16:52Visit Hired.com slash Talk Python To Me and answer the call.
- 16:55When you got through with Demo Day, I saw that you guys actually had two seed rounds.
- 17:09One for like $120,000 and one for $2 million.
- 17:12Congratulations on that.
- 17:14Thank you.
- 17:14That's pretty exciting, right?
- 17:15Was that first part sort of the end of YC?
- 17:18Yeah, the first part is from Y Combinator.
- 17:20And then at the end of Y Combinator, there's Demo Day.
- 17:22And that's when we raised our larger round.
- 17:25And that was to get us, you know, over the next, yeah, get started from there.
- 17:29Yeah.
- 17:29So what's it like taking VC money?
- 17:31That's another skill that you don't have any exposure to before starting a company, or at least I didn't.
- 17:37So yeah, fundraising is a very kind of interesting beast.
- 17:39You have to have your pitch ready, and you spend a lot of time talking to investors, and you're dealing with rejection, and also, yeah, communicating in this way that you're not used to this very, yeah, salesy way.
- 17:51Yeah, you have to have a very crisp message, right?
- 17:53But it's also different from selling to customers, right?
- 17:55You're, you know, for customers, you're talking about what's their immediate needs, and how can I satisfy them now?
- 17:59And when talking to VCs, you're talking about, oh, what's kind of the grand vision of what's the app going to look like in 10, 20 years?
- 18:06What's the, how big could we possibly be?
- 18:09Yeah, the customer wants to know, how are you going to help me make my store or chemical process better?
- 18:14The VCs want to know how you're going to reach, like, large-scale growth and continue user acquisition.
- 18:20Like, the customer doesn't care at all about that, right?
- 18:21Exactly.
- 18:22It's good, you know, talking to investors, you know, and they can really, they can be a lot of help.
- 18:25They can give you a lot of great resources, especially if you get good investors, which we were very fortunate enough to do.
- 18:30Another set of connections and network, almost as much as anything, right?
- 18:35Cool.
- 18:36So you guys started in November 2014, right?
- 18:39That's correct.
- 18:39And you started with Python from day one.
- 18:42What was the reaction with NYC for using Python?
- 18:45They give you a lot of autonomy to build what you want, so I don't think that anyone else really would have cared what we built it in.
- 18:51But it made a lot of sense for us as a company, you know.
- 18:53So both me and my co-founder knew Python, but I also could tell that this is, you know, would be really great for getting it started and moving quickly.
- 19:00So especially when we have this kind of short timeline of three months to get out the door before demo day, what can we use to really make sure?
- 19:09As productive as possible right from day one.
- 19:11And so Python was a pretty natural choice.
- 19:13Yeah, I guess, especially in the sort of accelerator type scenario, speed to market is more important than CPU cycles.
- 19:22Exactly.
- 19:22Or memory usage or whatever.
- 19:23Yeah.
- 19:24But you guys are sticking with it, right?
- 19:25You've been going strong.
- 19:26Yeah, exactly.
- 19:27So we have, yeah, almost everything is in Python.
- 19:30We have some of our, we have some things in C++ for some very high end optimization that needs to be very performant.
- 19:36And we use, you know, Python and C++ bindings for that to interact with the rest of our stack.
- 19:40We also, you know, we have JavaScript, of course, because we have a website as well.
- 19:44But everything back end is Python.
- 19:46Okay.
- 19:47That's cool.
- 19:47And is that Python 2 or Python 3?
- 19:49We are Python 2.
- 19:50Okay.
- 19:51Right on.
- 19:52And you said you had considered maybe using Go or Scala or some other languages.
- 19:57Can you just sort of discuss those trade-offs?
- 20:00Sure.
- 20:00So I definitely, I had some experience with both of those.
- 20:03I think Scala is really nice when I did use it.
- 20:06It's very safe.
- 20:07The type safety is really good.
- 20:08But it's very, it's still very expressive, much more expressive than Java or something, which it's based off of.
- 20:14And that's really nice.
- 20:15I think I would be less confident we could move as quickly as we could with Python there.
- 20:18You can be very expressive, but there's a lot of kind of tooling issues, like the compile times can be very slow.
- 20:23And also, it's perhaps not as well known.
- 20:26So you spend some amount of time training new hires or other people to use Scala as well.
- 20:31And I don't think that's necessarily a bad investment to make always.
- 20:34But when we were at this stage where we want to move very quickly, then we should stick with something that we can be confident about that in.
- 20:42And then I had a similar opinion about Go, which is like that was a great language and really has all nice features.
- 20:47But at the time, I believe it was still, you know, less mature than it is today.
- 20:51I recall wanting to use an AWS library.
- 20:54And for Go, there wasn't one at the time.
- 20:55I think there is now.
- 20:56But Python, of course, had a great AWS library just ready to go.
- 20:59So those little decisions of just like, I want to spend my time working on the core business and not tooling and not, you know, building third-party packages, which could already exist.
- 21:10Right.
- 21:11There's zero business benefit in you building a Go implementation of Bodo or whatever, right?
- 21:18Exactly.
- 21:18So I definitely think, you know, there's lots of trade-offs to be made.
- 21:21And that's kind of where we were leaning at that time.
- 21:23And I'm really happy with it now.
- 21:25So I think it's, you know, we've definitely, we've built a lot.
- 21:28And I don't think we'd be where we are today if we had perhaps started with a different language.
- 21:32Sure.
- 21:32So how much does SciPy and NumPy and all those pieces sort of play into this?
- 21:39Was that like pretty critical to making it work?
- 21:40Yeah.
- 21:41So we use a lot of that for kind of, yeah, high capacity computation and optimization.
- 21:46They're, you know, really great tools for that, that we love, both in the kind of prototyping phase where we want to try something new on some data set or something like that.
- 21:53Using SciPy, scikit-learn, NumPy are fantastic.
- 21:55And then also, you know, they have the performance we need to actually put them in production when we're appropriate.
- 22:01So we also have, of course, things that we built ourselves that are very well tuned to our own problem.
- 22:04And as I mentioned before, typically those are in C++.
- 22:07But having this wide array of tools available to us in Python is essential.
- 22:12Cool.
- 22:12And I heard you say AWS in there.
- 22:14Is that where you guys are hosting your SaaS product?
- 22:16Yeah, that's correct.
- 22:17Okay.
- 22:17Are you doing like multiple data centers and things like this?
- 22:21Or is it US East one?
- 22:22US West.
- 22:23Yeah.
- 22:24So we're still, yeah, there's lots, I would say we're still pretty small.
- 22:28So there's lots of, there's lots of improvement to do in a lot of fields.
- 22:31But specifically, yeah, we're AWS is, we're big fans of it.
- 22:37Okay, cool.
- 22:37Yeah.
- 22:37So am I.
- 22:52Gone are the days of tweaking your server, merging your code, and just hoping it works in your production environment.
- 22:58With SnapCI's cloud-based, hosted, continuous delivery tool, you simply do a git push, and they auto-detect and run all the necessary tests through their multi-stage pipelines.
- 23:08Something fails?
- 23:10You can even debug it directly in the browser.
- 23:12With a one-click deployment that you can do from your desk or from 30,000 feet in the air, Snap offers flexibility and ease of mind.
- 23:20Imagine all the time you'll save.
- 23:22Thanks, SnapCI, for sponsoring this episode by trying them for free at snap.ci slash talkpython.
- 23:38You guys have to really focus on API design because that's one of the primary ways that people interact with your entire business as a SaaS product.
- 23:47How do you guys think about that?
- 23:48Yeah.
- 23:49Using optimization tools like SciPy or like the open source or other open source optimization tools, one of the problems with them is that they're very, very difficult to use for a lot of reasons.
- 23:59One of them is, you know, the API might be, you know, very obtuse or not very well optimized to your problem or things like that.
- 24:08Another problem is administration.
- 24:10You have to have the servers and set them up and you have to know what kind of capacity you need to optimize your problem.
- 24:16Like if you use machines that are too small, then it will be very slow and so on.
- 24:20Right.
- 24:20But if you bit too many, you're just going to waste money on big machines doing nothing, right?
- 24:24So what we wanted to do was we wanted to make sure that we can take, you know, this very valuable tool, this optimization tool and really make it what's the easiest possible way to expose it to our customers.
- 24:32And so for that reason, it's one of our top priorities is having an API that's very, very clean, very predictable, very easy to use, does what you want, a small number of endpoints.
- 24:42You're not having to, you know, dig into the nitty gritty.
- 24:46You're not tweaking flags in our optimization.
- 24:48You're just saying, here's my problem.
- 24:50Tell me what to do next.
- 24:52Right.
- 24:52Do you really try to optimize for the simple getting started case and then provide additional features as needed or how do you do that?
- 25:00We want to make sure that, yeah, getting started is as easy as possible.
- 25:04So if you have your problem, you can use our API to define your problem and say, here are the parameters that I'm searching over.
- 25:11You can also use our API to say, here's what I've tried so far.
- 25:13And then our API will tell you, here's what to try next.
- 25:16So it's this very simple, like three calls, one to get started and then one to ask for a suggestion and one to report an observation.
- 25:23And that's really all a user needs to get started with SigOpt.
- 25:26And then to the extent that there are, you know, expert level flags, like if you really know that you want this particular optimization thing, we want to make sure it's possible.
- 25:34But we really don't want it to be users to have to know about it or have to be confused by it just to get access to the really powerful tooling inside SigOpt.
- 25:42Yeah, that seems like it's keeping with your overall mission of democratizing this machine learning and optimization in general, right?
- 25:51Yeah.
- 25:52Very, very cool.
- 25:53So let's talk a little bit about the open source engine that's kind of at the heart of a lot of what you're doing.
- 25:58So your co-founder, Scott, he used to be at Yelp.
- 26:01Is that right?
- 26:01Yes, that's correct.
- 26:02Yeah, he worked on this thing called metric optimization engine or Moe.
- 26:06Yeah, that's right.
- 26:07Okay.
- 26:07And so this is sort of one of the core components of your system, right?
- 26:11Yeah, so we definitely have, we've built more on top of it.
- 26:14And, you know, SigOpt these days is powered by like an ensemble of multiple optimization methods.
- 26:18But how we got started from the very beginning was this, yeah, this Moe that Scott had built using his expertise in the field.
- 26:24And that was the first prototype for can this black box optimization really be, can it be profitable?
- 26:29Can it be easy to use?
- 26:30Can it be something that people would want to want to interact with?
- 26:33And so Moe was the first prototype for that.
- 26:34And, you know, Moe was very well received on GitHub.
- 26:36Lots of companies and individuals were using it.
- 26:38And then some of the very common feedback was, oh, but it's really hard to use.
- 26:42Or, oh, perhaps it doesn't work.
- 26:44And then the reason it didn't work was because this one flag wasn't set.
- 26:47So he and I knew and could see that there's real, real value here.
- 26:51But the biggest problem is how can it be even easier to use so that companies of any size can have access to this really, really powerful stuff.
- 26:59Yeah, that's great.
- 26:59There's this opportunity.
- 27:01You've got this great open source tool, but you want to build a business.
- 27:06Can you kind of take me through the thinking of like, all right, we're still giving away this thing for free.
- 27:11And yet we need, you know, to make something special that customers will buy and love.
- 27:16What was the thought process?
- 27:18Just that it's too hard.
- 27:19How can we make it not so hard and accessible?
- 27:22Yeah, I would say that's, yeah, the biggest barrier to using Moe is that it's very hard to use.
- 27:28I think if people still want to use Moe, then they can, but they're going to have a lot of headaches with it.
- 27:34Our goal is that we want to be the people who remove those headaches.
- 27:37But as I said, so we kind of, we started with Moe.
- 27:40And now, in addition to that, we have a wide variety of other optimization methods that we've built in-house.
- 27:46Those are not open source.
- 27:48So using Cigar does also give you this kind of wider array of benefits, other techniques, other optimization, kind of cutting edge research.
- 27:55But you're right that like this, it is still open source.
- 27:58It is still available.
- 27:59And like it is still good for the community to have access to this open source stuff to kind of, you know, they can see where we're coming from and what's been built and the kind of background behind it.
- 28:06Yeah, I think there's a bunch of stories that are coming out of people building really amazing businesses on top of things that they're giving away.
- 28:14And I think that's becoming much more common.
- 28:16But still, I think it's really special to see examples of it in action.
- 28:21Like with you guys, recently I spoke to the Scraping Hub guys that took Scrapey and turned that into kind of a SaaS platform, you know, web scraping as a platform, if you will.
- 28:33You know, then there's like more obvious examples like MongoDB, Red Hat.
- 28:38But it's really cool to see you guys sort of turning this into a business starting from this sort of kernel of open source.
- 28:44Do you still make a lot of contributions to Mo or are there a lot of other people working on it?
- 28:49What's the story there?
- 28:49Some people work on it.
- 28:50Some individuals kind of like in the open source community have been contributing to it.
- 28:54These days, our contributions are mostly focused on these other methods that we kind of have diagnosed.
- 28:59Like we're able to diagnose like these are the problems that Mo worked well for.
- 29:02And then these are the problems that Mo doesn't work well for.
- 29:04And then how can we as a company attack those and help our customers who have those kinds of problems?
- 29:08And so we spend a lot of time focusing on that.
- 29:10And that's sort of perhaps tangential to the public Mo.
- 29:13So we're still working on that.
- 29:14At this time, that's still closed source to SIGopt.
- 29:16Right.
- 29:17Of course, you got to keep the secret sauce a little bit secret, right?
- 29:20Awesome.
- 29:21So can you talk a little bit about how some of the internal systems work?
- 29:25We talked about your deployments being on AWS, but is there like interesting architecture that you might want to talk about?
- 29:31Sure. So we have our web and API.
- 29:33That's, as I mentioned before, all Python.
- 29:35We use Flask in production to do kind of web serving.
- 29:39For the most part, we have like our API, which is a very thin layer that just accepts, you know, API requests from our customers of the form I said before where they're describing their problem.
- 29:48But then most of the work we do is we offload that asynchronously to these high capacity compute machines that are doing the optimization.
- 29:55So for these problems that are very expensive, we want to be able to, you know, run SciPy or these custom C++ algorithms that we're working on.
- 30:03Okay. Yeah. Of course, you definitely want to buy the highest end compute machine you can.
- 30:08It seems to make a really big difference.
- 30:10If you sort of double your VM and AWS, it seems like the low end is really low.
- 30:16Yeah.
- 30:17Yeah. It's great. You have this kind of flexibility to split up your architecture that way for these machines that don't need it and machines that do.
- 30:24Right. Do you, I mean, that's part of the beauty of the cloud, right? Like it's a checkbox or an API call.
- 30:29Are you guys doing anything with GPUs given how computational this is?
- 30:33We do. We have experimented with that in the past, definitely. Like for some of these algorithms, which are, can be really parallelized over GPUs.
- 30:40That's still something we're working on and experimenting with to see if it's worth productionizing.
- 30:43Cool. So maybe you could just like in a few sentences, tell people like, what's the deal with like computation and GPUs? Like enough for graphics.
- 30:50Yeah. So I'll be honest and say that this is not one of my deep areas of expertise.
- 30:55But my understanding is that your GPUs, you know, they're very highly optimized for this widely parallel computation.
- 31:03So definitely when you're doing these kind of expensive CPU bound optimization techniques, then you can use GPUs to get those done as quick as possible.
- 31:12Yeah. Yeah. It's pretty amazing when you look at it. I mean, when I first heard about it, I was like, really? What?
- 31:17Or doing like math on the GPU? I mean, of course, if you look at video games.
- 31:22Yeah. Like for a while I worked on 3D simulators and the amount of computation those graphics cards do just to render a scene is mind boggling for one scene.
- 31:32And then they do it like 60 or 100 times a second. It's crazy.
- 31:35And that was, you know, so long ago, many years ago that I was doing that. I was still super impressed.
- 31:40If you look at the parallels, I'm like, I've got a MacBook Pro Retina and it's got a pretty high end CPU, which I think has four real cores and each one is hyper threaded.
- 31:50So it looks like eight.
- 31:51But some of those graphics cards have like over a thousand cores. So trying to decide between eight and a thousand for parallels.
- 31:58Wow.
- 31:59Yeah. It makes a big difference.
- 32:00That's pretty insane. So, yeah. I remember a few years ago I saw on AWS as one of the machine types, like a clustered GPU thing.
- 32:09What is that doing in the cloud?
- 32:11But yeah. Yeah. Very cool.
- 32:13So you said you experimented with it. Is it looking promising or?
- 32:16I mean, so far so good. Yeah. It's definitely seems like something we might might want to go forward with.
- 32:20Yeah. I haven't really tried this computational stuff with it. There's some really interesting projects, but I just haven't had a use for that much computation, I guess.
- 32:27But it seems like if you find a case where it works, it works crazy good.
- 32:32Definitely.
- 32:33But it's not like a general computer, right? You can't just give it any problem. So there's certain types of problems that are really appropriate or algorithms and certain ones that aren't. So I guess, you know, that's kind of a big decision, whether it makes sense or not. Right.
- 32:44We're getting kind of near the end of the show. Let me ask you a few questions I ask all my guests. When you're going to write some Python code, what editor do you open up?
- 32:52I use Vim. I've been using Vim, yeah, for about eight years now. I think I'm, you know, got it pretty well optimized. I feel more productive in that than just about anything else. So that's what I use for just about everything.
- 33:03Yeah. Very cool. You know, it's very unscientific. Maybe I could pass a few data points off to your system and ask it. But I would say I think Vim seems to be winning the popularity battle among my guests anyway. I'm not sure if they're representative or not at the overall community. But yeah, very, very cool.
- 33:20And, you know, PyPI has 75,000 packages. Now, just it's insane. You know, how many things are out there that you can just grab and bring into your apps in Python?
- 33:31What ones would you recommend or what are really important things people should know about?
- 33:35I would be self-serving and say the SigOps API client Python package.
- 33:39Ones that I use in my own personal day to day. Definitely IPython. I get a huge amount of value out of just for the REPL and using IPython notebooks.
- 33:48Like increasing productivity over the regular REPL is kind of astounding.
- 33:52This is obviously a pretty common one, but I think requests, that's just like, it's become such a necessary part of my toolkit.
- 33:57Feel shocking that it's not part of the standard library at this point.
- 34:00Yeah, that's a really interesting comment. I agree that requests absolutely should be up there. It's the most popular package on PyPI.
- 34:07Oh, is it?
- 34:07By the way.
- 34:08I believe it.
- 34:08Yeah, it's so clean and so useful. And I was talking to Kenneth Wright. He was on the show.
- 34:15And it was the creator. He was saying they were considering making requests part of the standard library.
- 34:22But they decided not to because they wanted to be able to rev the features and security fixes and various things of requests faster than they do Python itself.
- 34:32So they decided to keep it separate, but to make it the recommendation to basically not recommend using URL lib, things like that.
- 34:40Go, no, no. pip install requests. This is how we do it.
- 34:43Let's just all agree on that.
- 34:45But yeah, that's pretty interesting, right?
- 34:46They actually considered making it part of Python, but for versioning and agility.
- 34:51Well, it makes a lot of sense.
- 34:51Yeah, yeah, yeah. They decided not to.
- 34:54Okay, awesome. If people want to get started with SigOpt, what do they do? How do they get started?
- 34:59Head over to sigopt.com, sign up, you get started. We have a free trial.
- 35:03And if you have any of these problems, whether it's a machine learning model that you want to make more accurate or some other kind of process that you're trying to optimize,
- 35:10you just sign up, get started with our API, and you're off the races.
- 35:14Okay, that sounds great. Yeah. So pip install SigOpt, sign up, off you go, right?
- 35:18You got it.
- 35:19All right, Patrick. It's been great having you on the show. This is really interesting.
- 35:22You guys are doing some cool stuff and continue to optimize everything.
- 35:26All right, we will. Thanks, Michael.
- 35:27All right. See you later.
- 35:29This has been another episode of Talk Python To Me.
- 35:32Today's guest was Patrick Hayes, and this episode has been sponsored by Hired and SnapCI.
- 35:36Thank you guys for supporting the show.
- 35:38Hired wants to help you find your next big thing.
- 35:40Visit Hired.com slash Talk Python To Me to get five more offers with salary and equity presented right up front,
- 35:45and a special listener signing bonus at $2,000.
- 35:48SnapCI is modern continuous integration and delivery.
- 35:51Build, test, and deploy your code directly from GitHub, all on your browser with debugging, Docker, and parallelism included.
- 35:57Try them for free at Snap.CI slash Talk Python.
- 36:00Are you or a colleague trying to learn Python?
- 36:02Have you tried boring books and videos that just cover a topic point by point?
- 36:07Check out my online course, Python Jumpstart by Building 10 Apps, at training.talkpython.fm,
- 36:12for a different take on learning Python.
- 36:14You can find the links from today's show at talkpython.fm/episodes slash show slash 51.
- 36:21Be sure to subscribe to the show.
- 36:22Open your favorite podcatcher and search for Python, which will be right at the top.
- 36:26You can also find the iTunes and direct RSS feeds in the footer of the website.
- 36:29Our theme music is Developers, Developers, Developers by Corey Smith, who goes by Smix.
- 36:34You can hear the entire song on talkpython.fm.
- 36:37This is your host, Michael Kennedy.
- 36:39Thanks so much for listening.
- 36:40Smix, take us out of here.
- 36:42Stating with my voice, there's no norm that I can feel within.
- 36:45Haven't been sleeping, I've been using lots of rest.
- 36:48I'll pass the mic back to who rocked it best.
- 36:51On first developers, developers, developers, developers.
- 36:54On first developers, developers.
- 36:56On first developers, developers, developers.
- 37:00developers.
- 37:02you
- 37:03Bye.
- 37:03you