scale.bythebay.io: Functional Programming for Machine Learning Panel
Recording: scale.bythebay.io: Functional Programming for Machine Learning Panel
so we're gonna have function programming and machine learning and definitely you know machinery is math and math is very functional however if you look at a kind of how the world is you guys need to yes sit on side okay that's awesome so but if you look at kind of all the new tools you see a huge adoption of Python and you also see that even tensorflow just recently announced that they are now going to support an imperative mode for tensorflow in order to make it easier for their users to use the tool so is function programming really the future of machine learning I think that's a great question for a debate and this is what we're gonna have today so we have two teams of three people each and guys since this is a you know Friday at 5 p.m. let's make it fun and I'll let the first the team say introduce yourself we have the team that is for Lea Oscar and Chris Chris you can share in the team that against will go next so guys introduce yourself hi I'm Lea I actually work at Salesforce Einstein on Batali's team I've been working in Scala solving machine learning problems for about three years there before that I was at LinkedIn and before that I was doing computational neuroscience at Berkeley yeah I'm Chris McKinley I'm a director of engineering attacked were a small gamification company about 80 people he's mostly Haskell and do a lot of machine learning my name is Oscar Boykin I work at stripe I work on the machine learning infrastructure team with several other Scala type people we do most of our machine learning infrastructure in virtually all the machine learning infrastructure and Scala before that I worked at Twitter where we did most of the data engineering ultimately almost all of it using Scala so that's background with it okay you can kill the Mike and the team that is going against just guys please the team that is going against their doing for the sports they're not really against oh please not so please anything so let's hi so I'm Justin coffee I work for Crito we're an app tech company we follow you around the internet we're not as bad as Google those nice people but that's what we do I run the analytics infrastructure team they're so responsible for all the data pipelines databases all that good stuff and we use quite a lot of what this guy did scalding and all that good stuff so yep hey guys I'm Ajith gray well I'm am here at Twitter we work on recommendation systems I've been here for about five years I was an engineer when I started we work we use a lot of Scala inside whereas probably a lot of you know a lot of the stuff that Oscar has belt has helped us scale at the company before that I was at Yahoo working on language processing systems and using a lot of Python that's my background cool so my name is David Andrew jet ski I work at sumo logic we're a cloud based machine data analytics platform in a kind of scala shop since 2010 I've been there since 2011 I work on the data engineering and machine learning side there and prior to that I was doing machine learning research at Lawrence Livermore Lab and I also co-organized a machine learning meetup here in San Francisco okay guys thank you so please first of all give a round applause especially for the team that arguing against for being good sport so but the way we will do it is will gonna have it in Oxford style because otherwise it's gonna be a little bit unfair so actually the team that is gonna win is the things that will swing the most votes so we'll have a vote now and again the proposition is functional programming is the future of ml so please if you're for raise your hand and we have here my lovely assistant my uke who is can I use the very advanced technology of taking a picture and then manually count their hands and if you are sorry again the proposition please raise your hands Wow well begins guys you have a lot of what what's the swing I don't know about you guys by the way everyone who didn't raise their hands at the beginning please we also will count your votes so you know if by the end of this one one team did a better job convincing you so please vote for them so let's start we're gonna start with a very short intro from each member will do it kind of team by team so who's gonna first on the for team you guys will have awesome so take it away alright so see I guess the argument that functional programming is the future of machine learning so basically if you think about what machine learning is it's a lot of math applied to data and if you look at sort of the proliferation of machining libraries out there there are many of them they're written in many different languages but a lot of them I would say probably the majority of the ones that become really big these days end up having a Python interface and so the question that I would ask is why do they end up having a Python interface and I would argue that that it's because python has a low barrier to entry so basically you don't have a build system to worry about you don't have to learn how to deal with types basically anyone can use it it's sort of simple it's the the the easy way to get things done and get started and so with that argument of like basically the reason that it's getting this interface is because people can use it off the shelf I would argue that as machine learning evolves as it becomes more standardised it's actually going to move further away from or the interface will move further away from programming and become basically GUI based so it will be drag-and-drop programming of machine learning so it won't be written in Python it will be written in think that is you know optimize for doing machine learning and I would argue that basically if in that case functional programming is the optimal solution so if you think about a drag-and-drop GUI basically what you want to define is what's going in and what's coming out you don't want to worry about any sort of objects that's that's basically the the paradigm that best fits this model and given that we will move further and further away from programming everything in Python because data scientists don't really want to do Scala or other complex languages basically they also probably don't actually want to do Python don't want to use gooeys and the backends for those goodies will be functional programming okay awesome Thank You Leah and I think Justin you were next so thanks Leah for stealing all of our good arguments for why functional programming is not the future of machine learning so I would like to so I'm going to try to channel my inner Steve Ballmer without embarrassing myself too much so data scientists data scientists data scientists right so as precisely the the tact that I'd like to take which is that indeed the the target audience here is not us where the engineers building building lots of systems we're building type safe data pipelines and all this good stuff that are feeding these industrial-strength machine learning systems but data scientists are the ones who are actually bringing the value out of that system and indeed you look at tensorflow you look at a lot of these things and they seem to sort of compile down to config files right at the end and this is a model representation which is the static representation that can be then interpreted by various runtimes right so you have things like PI torch Interop with cafe - right so you've got this relatively high level language that has a low barrier of entry thank you - the then is able to be executed on something that's not necessarily functional programming right and so the the runtime of these things is going to get ever more optimized because we're dealing with more data and so the while we'd like to you know insist that correctness is more important than performance we know that you know from the various presentations we saw today that all of this correct functional correctness all results into you know imperative programming underneath the covers and so I think that yes you know type safe data pipelines will continue to be built in functional functional paradigms but you're gonna go from these very high level things which might end up being gooeys all the way down to really really low level systems programming that's highly optimized and I'm not sure that functional programming has a long term future they're awesome Figgy dosing so arguing for the prepositions Chris okay I didn't really plant my statement out form I hope it doesn't ramble without definitions of functional programming machine learning and future of it's hard to say anything really definitive but if I mean certainly if we define the future of to be increased market share then I think we'd win if we define functional programming to be I don't know Hadoop or spark then I think we won already but I don't know in the interest of saying something like more introspective it seems to me like data science is still pretty under defined it feels a little bit like front-end used to be in the early part the early aughts and i used to do a lot of data science work and i did most of it in in so i could learn and then spark and i'm much much happier doing stuff in haskell i also don't think it would have been possible for a small startup to use Haskell like seven years ago but it's certainly possible now and we're not the only company doing it and I think you'll probably see more and more of that in the future mainly because doing machine learning well is hard especially doing it without a lot of technical debt there's just a lot of incidental complexity that you have to control for and in order to do that well you need good abstractions and one thing that FP provides in spades is really good abstractions I treat hey thanks Justin for for starting that off so like Justin was saying data scientists are the the core driver behind a lot of the machine learning innovation that's going on in terms of like what are the problems that machine learning is solving more and more what so I've been using Scala for a while and the strengths that we that scallop provides are the ability to have these abstractions and and have like type safety across complex feature pipelines that you build and the ability to change those features in a type safe way across like a big codebase and and have like compiler do a lot of the heavy lifting and that is that has been the strength for for Scala and we've used that a lot more and more in the future what's going what's what I have noticed is happening is that the feature generation itself is being pushed down into these deep learned models so what you end up doing is your features are these is these these numbers and these matrices that you just want to push into into into some deep land model and and in that world the data pipelines themselves are not that useful and another another point here is a data pipe data pipelines are useful when you have a if you if you have like a tight loop between user generated content and and the user generated labels but in many of these domains like for example language processing which my background is in we have expert provided labels where the data sets are smaller and the kinds of questions that come up in those datasets are are not about type safety but about say avoiding bias avoiding avoiding some of the other issues that can creep up in such situations and those are the real questions that I would argue that in the future of machine learning we need to solve and in that case having like a much more flexible environment in which you can articulate these models and iterate on the on those models is the is is the one that is going to provide the most value to data scientist in terms of production izing like Justin was mentioning it's it's nowadays relatively easy to write code that build a model that dumps out a thank you so Oscar so that was like four years ago I had probably too much to drink no no definitely too much to drink at Twitter end of the week thing and I made a bet with him with one of my colleagues she was a little bit of a f:p skeptic it was too much money I hope he is forgotten how much it is that a functional programming language would be a top-ten programming language within ten years and at the time it was like it's on the borderline sometimes I've stopped for a moment said maybe that was crazy but I'm absolutely sure that now I would zoom back out I would make I would take even a stronger case that functional programming is the future of programming in general or there are their programming languages that are getting less functional I'm not aware of any you know so so I don't know if you want to talk about it's no go it's not getting less functional it was a language made seven years ago it's gonna get more functional Java is getting more functional Python is adding types in Python 3 like the direction is very clear here it's not like Haskell is like wait a minute slow it down here everybody let's put some more mutation into the picture so so the direction is very very clear I think you know we always already talked about like you know I don't know what the terms are but if you come down to like are you doing functional programming if you're writing Java and you're writing the doop you're still doing functional programming you're still doing MapReduce maybe you're you know you know you have to squint a little bit to see the right monad and play but it's still functional programming and it's getting more functional so I don't really think you can say very credibly that that vector is not going to keep going now are there rough edges absolutely everybody knows about it but I don't think we have to restrict ourselves to like fighting with a compiler to see you doing functional programming I'm Chris Chris the closure dude you know he's not down with types at all but he's very adamantly a functional programmer yeah ricky-ricky yeah he does look a little bit like Chris went solo if you squint so that's what I was thinking so anyway III we can keep going but I'm absolutely sure that this is the future okay awesome thank you also for bringing in the passion so isn't baby thoughtful active oh yeah close it out all right so the question before us here is you know will or is functional programming the future of machine learning that not should it be or would we like it to be or something like this and if you're looking at kind of what we're who are the winners today you know so the right before this justin was fishing out some okay what are the top programming languages of self-identified data scientists number one JavaScript I think then you know we go down the list and was this sequel Python something it may be C C sharp yes so okay these are where where the people are this is where the market share is and you know the growth in machine learning and data science is going to be you know this democratization of it it's not going to be kind of in the nuts and bolts data engineering necessarily that a lot of folks are providing a ton of value doing but it's going to be the domain experts who just want to get it done they are and if you look at what is kind of the winning you know trend today if you talk to somebody who's just trying to get it done in some you know programming context they love what do they love notebooks Jupiter notebook you know things like this now is this really functional a functional programming environment or is it super mutable hot mess of global variable of workspace right this is what people love this is the democratization this is where it's going and you know there might be some functional programming stuff happening way underneath in whatever your stack we've got but you know the 80/20 the future of the bulk of the value the business activity the creation what wins in the marketplace is going to be really really fast quit you know fast we weren't joking about you know what how we think about this is fast and furious quick hacks you know iteration getting experiments out you know lean product development everything like this by domain experts and people like that not necessarily worrying about referential transparency or you know making sure that they're there some types are properly aligned to the business domain or things like this they're going to hit enter run the model push it off again until they get something that works and with some of these new deep learning advances what you actually see you know when you're talking to researchers wma is they'll say actually I supplied the wrong input I had a bug in my code my deep learning optimization was so good it still worked so you know this this is the future is people you know hacking on notebooks with deep learning models that paper over their mistakes this is you know this is how how we see things going out so should it win you know who's to say but will it win I don't think so okay awesome [Applause] so thanks for the team for their opening statements let me just recap them very quickly so the team arguing for I kind of said that you know sorry people are moving to Python not really because it's imperative sorry about that not because it's very because it's simple you don't see people flocking to you know C or C++ right so in the future is probably simply even simpler and you know simple today if you take sequel or Excel it usually means a functional also the team added that if you know you for ml you need a very good abstraction functional programming provides this abstraction in the future is kind of you know getting this abstraction better and better enhance you know functional programming better and then kind of Oscar capped it off that you know function programming is not just the future of machine learning is the future everything is the future of self-driving car self-driving planes and that everything will become a functional programming the team arguing the team arguing against is kind of the same in that they made that machine learning really is about becoming more and more about optimization fine-tuning and this is where really it all boils down eventually to imperative and another point that was made that the kind of data scientist what you know simple environments and I guess you know a imperative problems offer that and I think David kind of caps it off with kind of the future is about growth growth is about democratization and we relations about getting things done easily and really today kind of the imperative paradigm owns that world so anyone want to respond to any of the arguments that were made by the other team probably respond I'm sure the guys responded then we'll open up to questions from the audience so if you guys have I thought David made a pretty good point and so it's hard to really refute that in any categorical fashion but it does strike me as pretty pessimistic view of the future I mean there are examples of you know programmers improving the way that they do things go to statements used to be popular at some point and now they're never used I think industries do also consolidate it used to be pretty easy to write JavaScript in any way you've wanted to and throw something up on like a lamp stack and and get paid and now you can't do that you need to know react so I don't know maybe the same thing will happen in data center yeah so I think I think the the four-team is what they're really trying to argue is that you know the entire world is gonna end up being functional you know sort of despite themselves and can be dragged kicking and screaming into this monadic paradise I I don't see that that's that's that's that's not what I see I don't know about you guys but I certainly don't see that in my day-to-day activities either interacting with our clients so our analysts you know try to explain to them you know the value of immutability and they're like their eyes start glazing over within like 35 seconds and they're just ready to go leave right and and that's with our that's with analysts I have the same conversations with engineers right and maybe I shouldn't say that right now don't come work for Crete CEO Oscar right but I actually do come work for us but the the III I don't think that the [Laughter] if I go in on that long is it this is that boring I like to thank my mother my father you know and it's it's even difficult to explain to or to convince engineers who come from a object-oriented or more imperative world that no you need to learn these these functional paradigms because just thinking this way can help you a reason better about your code and deliver something that's that's safer and more robust despite the advances of despite MapReduce because of MapReduce III we we've already got the obviously correct position and I I feel a little bit bad about exploiting it but like but like medallion even threw us a bone that I didn't even hear us make but like I just want to like isn't it already like I mean isn't we are haven't we already run I mean Excel and sequel are already functional programming languages and already the number one ones okay so so that's all I call ready like that's the case the second thing is I think you are all being very very myopic this industry changes a lot it wasn't that long ago that it was absurd to imagine running a garbage-collected language like are you serious you can't run that in a service like in production and now like you know basically no one you know that very few of us here are probably writing code that is not running with garbage collection like if you look today and say like is it painful to do thing extra thing why lecture it's gonna be less painful in the future it's oh it's not gonna get harder it always gets easier so all these things are gonna get better and it's not good like are you serious do you tell me that your Java eight people you talk to you're like man I'm really pissed about these like lambdas like all of a sudden they're all on board now like that's pretty cool they're gonna put case classes in next like that these things are actually happening even Guido's like alright we're gonna do a pie thumb three we're gonna put the types in so I mean any one of these you don't have to have the whole picture I don't think that we don't have to win to convince you that we have to write everything in Haskell we just have to say that some notion of the future of programming and it's a big tenth of all these ideas is like more of the future and I just I think it's a really high barriers that you either just say we're gonna stop advancing at all which I kind of would sound like you're saying which sounds really weird to me I don't really see how computers stop it man seem really soon or some other paradigm kind of wins but I just like like where show me that show me is there any audience questions well you guys prepare I think someone's about to troll Oscar I won't roll Oscar is sparks dataframe API and argument for or against functional programming [Laughter] look there is a real IQ you I don't want to be an ostrich up here like there are challenges to writing performant in some cases functional code and spark does have like a you know market pressure to write optimize the costs and they chose to do that by a certain API they could have taken other choices they could have done much of what they've done with macros or compiler plugins to get the same kind of semantic understanding of the code that they chose to do in that API but instead they went with the implementation that they did and I'm sure they had a lot of good reasons for it but you know that's like one implementation so I think that I think that along the way I mean like let's let's not forget that like Bert got where it's where it got running on Scala using lambdas using types they were able to distribute the computation they were able to give people a model to to formulate the code it's not like you write a while loop that like like updates a bunch of mutable variables and someone has a magic wand to put on it and it runs on a thousand computers so that mindset of like distributed general programming was what allowed us to scale to programming thousands again like I'm an old man now I'm not enough to remember when it was a research problem of how could you ever program a thousand computers and now it's like you don't really think about that now we feel like we know how we do it and we only know how to do it because of functional programming anyone else so well raise your hand it's here Ronde so here in the front such a hold of your thought for a second when I'm asking again you know probably Oscar will monopolize the sensor as well but I want to kind of help you know kind of the fellas here on the ever you were born and you guys are nothing but Oscar are you saying like you know people are not writing well but if you look at pie tours if you look at tensorflow that exactly what they introduce that they're bigger a big announcement was that oh my god now I can do four loops like you don't have to like thinking crazy Dax anymore so what do you guys think about that well returning the previous point I mean if you use if you use frameless then data frames are pretty functional like I'm sadly you know progress comes in fits and starts so it's not like we are monotonically marching to a strictly ever more functional world that's not that's not what we're saying and there are plenty of programmers who have not yet enjoyed the bliss of like the functional Narada you know they're still going to be I'm not saying that tomorrow we're gonna turn it off but there's never gonna be another mutated variable but you know III think that'd be I I mean I'm just gonna repeat that the arrow is pretty clear and I don't really feel like it's I mean Scala is increasing an adoption Scala is like not decreasing an adoption Haskell even is increasing an adoption languages are adding functional features like tell me a language that removed one so the the point that you're making is that languages are getting more functional whereas for machine learning it's more about what are the functional capabilities that data scientists are using and the fact still remains that data scientists are not and are not gonna or there is no incentive for them to learn about functional programming to solve the tasks that they need to all the innovation in terms of what are the machine learning models what are the what are the what are the different modeling techniques they are today are about the architecture of the models and pushing things down into the model and not about hey let's use this this monad or these other functional programming features like get rid of immutability and so on so that's that that's not that's not place where machine learning is so I would argue basically that there is there's something of a distinction between a lot of what is data science and what is like machine learning for production right so that hot mess of jupiter notebooks does not get shipped to production right like that that has to be translated into something else and so if you are going to actually put something in production you need something that you can trust and to end that will throw the right errors right and that ends up being in a more functional environment so I would say that basically the future is data scientists will in fact want to have their their actual model shipped to production and so the thing that will happen is that the tools to build those models will become closer to what neat they need to be to have their model in production which means that the underlying tools become more functional unless a hot mess of variables that change so I think that something that we need to quantify which we can't so it's helpful is it is what percentage of data science is actually going into production right do you need to get value for something to have value does it need to be a long-running service right and I I would I would argue that there's a lot of business insight which is going to drive what production will be right is you know sort of post facto analysis point and time analysis which is now data science driven and not just you know old school time series and these sorts of things have a perfect life cycle in a notebook right and what is a notebook but it's a way for you know this so this sort of analysis right it's it's it's it's it's this hot mess it's this interactive you know it's like print line debugging or whatever and in terms of you know you you build a little data set you get a shape of it and you iterate you iterate you iterate you iterate you iterate until you get to something and then you stop and you say that's my something and there it is and the work is over right by the way for that cycle that is cool that's great there's other holger thought there's nothing non-functional about that what is non-functional about a notebook you have a bunch of let bindings in what is even mutable about it the past already happened on the upper on the part of the page you can change so you can go back and change the cell you can you can what that's not far P is not functional so finally Oscar is lost for words III feel like there's a little bit of sleight of hand going on that like it's kind of like you I think you could translate all your arguments and say data scientists are not going to be interested in sub classing to get their job done like subclassing is like like that really what they need to be doing or like writing classes is a little weird they don't really need to be doing that those are things that you kind of presume that there's a background knowledge that they already knew and they could just write you they're gonna write classes in in Python but like somehow that came for free but like new people have to be taught and they can be taught different things and I think these different ways that we're all using like we're all old folks to us like you saw we're still stumbling on these like new concepts ok guys let's give birth a little bit yeah so my question is this so don't you kind of feel a little bit of added deja vu here so like if we were to wine like 15 years back or 20 years back and people will be saying hey listen the world needs faster rule-based systems right is it that you're telling me that that this machine is gonna tell me where I Drive my car something like that so so and you're talking about this you know the convexity and existence of solution and this gradient descent is what I talking about like well all we need is faster better rule-based system and there is even Prolog in the Windows operating system so so you know let's just go this direction and and don't talk about this you know high level stuff just like you said a referral integrity and all these things it's kind of too complicated for people to understand so it kind of feels like deja vu so necessary which team is the question for probably the against afford you guys so I I just I want to roll the roll the question back a second there we'll keep that transaction open and I'd like to address I think to address Oscar here so Oscar's argument appears to be that no seriously everything's functional oh my god like you know like just because so you know a sequel query looks a lot like a monad it's so sequels functional well there's no recursion in sequel so to my to my knowledge right so there's some aspects of things that appear to be functional and this is this goes back to two Oscars a perspective that you know we are going to make everybody functional despite themselves and and I think that that's I think that's the sleight of hand that Oscar is is referring to so I think maybe I'll pass the not a problem but they're referring to whether weak basic experiences - of who moment were we saying oh my god you know it's like all goes back but we're in for is that a fair summarization so so this so that if it might be that it feels like it's a it's a deja vu moment and there is like the rule-based system so the analogy that you're trying to draw is that arguing over whether deep learning is is gonna take over the world and that's the new rule based system that's going to do everything is that the analogy but it's I guess for I don't I don't have a I don't have a strong argument against that I get it it does seem like deep learning there's like a lot of iteration on like what the deep learning systems are capable of i unfortunate of the background to help answer some of that yeah it's just when I gotta take it down a notch share and let me get to governing dynamics so for the for team like what what are the governing dynamics like what is the value add for a functional programming that's going to inevitably cause it to take over machine learning as a discipline and then for the against team what are the governing dynamics like what is it about functional programming that is going to prevent it from taking over there over there machine learning would yes so this this you know partially what we can look at today is like what is hindering you know pure functional programming approach today for this like data scientist who is you know playing around with their notebook and I would say I want to add contra Leah's assertion you know I'm sure the fine folks at Salesforce Einstein are not going to ship their Python notebooks to production definitely not but you know I think this in this democratization world I'm sure it has happened I'm sure it is happening I'm sure this is you know the the future explosion of machine learning is going to be you know that there's it's going to happen it's already happening I'm sure so the you know why why do they want to not necessarily define super well-thought-out referentially transparent functions and kind of compose their blocks out of this when instead they can just say hey everything is in my notebook namespace because I'm just throwing a whole bunch of statements and variable bindings and assertions on am i nope I guess if I pretend the entire notebook is one gigantic lambda expression or something I can sort of squint and say this is a pure functional notebook within the world I mean that it's like being an ST monad or something I never leave the notebook and whatever I do in here anything goes but you know this it's it's really not you know it's that it doesn't have that property and this why maybe you would not do this is if I'm writing a quick little helper function or something I just I don't want to think about what are the inputs and one of the outputs what's going on in this notebook I just say okay I have this pile of garbage and I want a different pile of garbage with a table in a regression model on top of it or something like this and I I don't want to think about the inputs I don't want to think about the outputs I don't want some types I don't want product types I want thing at the end that I can push to production right from my ipython notebook which I'm sure again I'm there's probably a startup that's helped you know that's probably their tagline push your Python notebook to production and you know so this I just want to get it done if it is run out the door right now so you know this anything that gets in the way of me getting this done and you know maybe my future self if I'm some data engineer building principle pipelines and I'm on call for this system and this that any other thing my future self will wish I had thought a little bit harder and you know refactor this into a proper pure function that I can reason about and compose but you know the this the dynamics this marketplace it's you know worse is better like you know get it out there and iterate fast and win win this this these pressures are going to be pushing for if I can get some advantage now and pay later though those that's going to win out in a shocking number of use cases and and that's my assertion or about the fundamental dynamics and why they maybe don't favor the 40s for governing dynamics so yeah I thank you for that clarifying question so I think I would summarize their argument as like it's all a pile of trash and everybody's really bad and like that's just going to be the way it is and there's nothing anyone could ever do and our argument is that technology tends to get better programming like computer science technology tends to get better I find I think that if you don't want to think about the inputs or outputs to your function I've got bad news for you like even even non-functional programs have to think about inputs and outputs their functions so I feel like like it's you know yeah you can write trash functional programming to like I've seen plenty of it like don't worry there'll be plenty of opportunities for them so I agree if you have to struggle with everything it will be a problem I think our argument is that it will it will as things develop it will be less and less of a struggle and so you know just like manual memory management used to be a problem it's not a problem anymore you won't really like it's kind of a weird thing to say like aren't you worried about all that memory usually people are not I think your your statement of how will I make this fear pure function you'll just be like I don't even know what that means exactly because I'm just making a function so like a good a good language that works I'm not saying it's going to be one that we have in our hands but all of the ones are moving in that direction and it will be easy and there will be tire fires and we'll have them functional tire fires and it'll be great so I just want to push back one bit on you know that this is a pessimistic view I there's some dramatization for effect going on here no doubt on our side but you know there might be I could sort of make another controversial claim that in some of these applications it might be the case that quality in this some of these software engineering consents may be overrated you know if they if you're exploring the space of ideas really quickly and you're delivering some value you know people are not you need to say why do people put up with some of these things today or why do they make one choice or another you know they they maybe their objective function for what they're trying to ship is different and you know they might be very rationally trading off short-term gain for perhaps longer term pain and you know this that might be a faster way to kind of explore the space of ideas and deliver some business value and find some new sort of problems that can be solved with these machine learning and data science techniques and on some level that's like part of the hypothesis of this democratization of the technology right is that you know it's not necessarily it might be a little messy it might be a little improvised but somebody who knows something that they don't that you know somebody who knows a lot about functional programming might not know a lot about the domain and you know it might not be a perfect like crafted functional programming approach but they know a lot about the domain and they get something super useful and valuable out there you know you can kind of look at and say oh you know this ipython notebook is a tire fire but you know if it's doing something useful and finding something and kind of moving the ball forward from a business or under user value we can kind of pave over or forgive some of these other quality you know quote unquote software quality issues and so it's not necessarily pessimistic I mean there can be a ton of really cool innovative applications that people will get to by iterating superfast I mean if you're talking about driving economic value you can't do that and ipython notebook like the news fees not driven by an eye Python notebook I mean we have we have that concretely you know my place of work we have business value being brought by people doing stuff in notebooks you know in an ad hoc way analytics I mean the analytics have been around forever there's their you know spinning up whatever tensorflow in the background and the whole nine yards you know the I think that so while we're trafficking in polemics and false dichotomies to highlight go back to david's startup idea called you know pusher your Python notebook to production dot IO you know the idea that you know you have two startups on the table one is push you know the pusher Python notebook to production IO and the other one is convince your data scientists to understand monads dot you know org or something I'm investing in the pusher notebooks to production this is model right because and and and okay you know exaggeration for effect but the the point is is that yeah there is business value in that stuff and and in the you know people deciding where to spend money they're looking at where they get the most value the the the most quickly from so I would I would argue that that's true there's business value from it right but there's also a cost mistakes in it and so if you have tools that have better guard rails against mistakes like passing the wrong data type into your function then you know those those have a serious benefit and will convince people to use it because it actually cost money if you're making business decisions off this like hot mess if you can avoid mistakes by having a easier more more guardrails basically on your system then that's really worth adopting yeah so I totally agree with you I think that's a great point and I'd like to bring human nature into this discussion path of least resistance short term value optimization versus long term value let's take a look at you know banking regulation stock market CEO pay you know stock options and the whole nine yards right I mean human nature is to optimize for short term value and not long term value that's what we do right and I think you're making an argument that there will never be a better DSL for any kind of machine learning than an AI Python notebook which seems untenable in the face of like all economic rationality III I feel like you're begging the question you're saying because women are here for it would be usable therefore because it's impossible to be usable no one's gonna want to use it'll be too expensive to use but we're trying to discuss like our position is that it will be much more usable in the future so just to reiterate that I think you you keep saying these things as though it's like like an absolute say bit of fact that like you've got to understand Mona it's like you don't have to understand GC algorithms to use Python you don't have to know it's even referentially counted like you know the reference counted you know it just fades into the background because it just kind of works for we're arguing not that you're gonna like you know be a category theorist in order to do machine learning we're arguing that these tools will make it very easy for you to do functional programming like you're doing when you're using Excel so we have a last point but let's say in the meantime everyone who's not answering the question will have a round of closing statements you guys will each have two minutes of heating Oscar will be 10 but you will still have two minutes you just close your statements so let's take last question cool so I thought the question about governing principles is really good and to play devil's advocate as well and like narrow the scope because talking about machine learning is a huge field let's imagine something like logistic regression in particular basically the ideas is that you have some weights you want to learn those weights that's some state describing them that through iteration feels very natural so I think that does kind of beg the question of what does functional programming add in that context and so that's my question to try and make because I do kind of agree that this has been an argument of like there's trash and maybe we can shine it into gold I think there are other arguments to be made as well so for Team you want to take it sure what FB has always been backed by imperative code at some level a computer is an imperative machine and no one actually codes up logistic regression anymore you just use it like a function so it seems like a little bit of a category bending question to say will people use like a state monad to run the like gradient descent loop that optimizes logistic regression yeah I guess you could do that but no one's I don't think that's what we're arguing we're arguing for more restrictive tools in spaces where mistakes are very very costly okay awesome so we're now on the final round and let's say switch gears a little bit the team that is against the proposition you guys who ever wants the first star with your closing statements a little bit of advice will make it very powerful if you end your statement with and this is why you need to vote or our preposition or against yes so I can start I think you should vote against functional programming being the future of machine learning because a lot of the arguments that have been made everything is going to be functional programming and while maybe the underlying tools you can make the argument that hey there they can they can convert they can be funk they can be functional programmed the work that's being done in machine learning is going to be on the data scientist ID and a lot of the stuff that they're a scientist use the programming techniques that they will use data scientist today are more comfortable with a non functional programming approach and I don't see a case for why that would change in the future okay Thank You Jace oh yeah so the reason I'm going to argue that functional programming is the future of machine learning is that basically functional programming provides better safeguards against very costly mistakes in developing systems that even if they're not shipped to production provide you know real monetary cost to to a business that is trying to use machine learning to in order to make decisions if they are ship to production then then of course it's it's hugely important that these things run reliably and so as tools improve they will tend to take on more of the characteristics of functional programming and the data scientists will simply use the better tools without understanding that that is what's happening to their tools and so that is why functional programming is the future of machine learning awesome who's going next on the again steam yeah so I think edgy said it best you know the sort of if you accept in some senses if you accept that functional programming is going to take over every single domain of programming then by definition right machine learning is is is going to be functional right or the engineering around machine learning is Leah put it is going to be a functional I I put forward that well I think that there is a strong core of functional programmers all of all of those folks here and that there are inroads in terms of functional paradigms making into things like JavaScript which you know I think to a lot of people even five years ago would have been you know like what right the the fact is that it's still a huge minority share of what's going on in the big wide world right whether people know it or not I think is actually important right that's a semantics that's important because if you if you don't if you're mindlessly doing something right how are you actually taking advantage of what's happening you have to understand you you know you you can't just you know plug a and to be and hope to get C reliably if if you know once these things are put to the test and deployed and under under load you you have to understand the internals you have to understand what's going on right and so I don't think that the the functional paradigm is necessarily going to win the day of every single system that's been that's that's being deployed into production and so I don't think it's at all clear that machine learning which is sort of inherently iterative and imperative is going to and especially with the advances in sort of deep learning obviating the need for some amount of fancy future engineering and all this other stuff is not at all clear to me that thank you Justin that will happen so now closing for Chris I think you just proved our point I'm if you look at like the long arc of history um it I don't know see it's easy to get confused about things and if you take a historical viewpoint it's pretty clear that things get more functional like 15 years ago the main way that you paralyzed code was like you use openmp or MPI and painstakingly with a dedicated data center that you pay IBM for paralyzed code and the idea that you would use like a concept or a pair of concepts like map and reduce to cheaply deploy parallel jobs on commodity hardware people would have on a panel like that totally laughed at it but now not only did that happen like in one company but then every single company had to do it just to compete and competitions real and if there's a better way to do something it will eventually get adopted if it really is that much better and I can't imagine a conference like this or a panel like this ten years ago it seems unlikely it's even sort of unlikely now but I don't know having been here the last couple days I've seen nothing but talks about dsls and better ways of doing machine learning like Oscar just gave a talk about using functional reactive programming paradigms to do feature engineering to solve a complex problem with like test training slip or feature slip and that's a real problem like if your features are joined in a way that's not time sensitive that can cause data leakage in a model or test training skew in a model and cost you a lot of money so if that's actually a real advantage in the market it's gonna be adopted like I'm gonna go back to my company and take all my FRP engineers off for reflux and start doing it in Haskell and you know if that helps us and maybe other people do too yeah awesome thank you Chris and David engineering is all about trade-offs and you know there's it's definitely wider than just the purely technical ones and for us to say okay incrementally things gradually getting more and more functional given the sort of assertions of like overwhelming superiority of this family of techniques you have to ask the question of why hasn't it already won and there must be some reason some kind of governing dynamics that are sort of pushing back against this and part of it is this implicit you know if we define functional programming as okay referential transparency and this is the big impure functions these are the big the big kahuna these are the big pieces right in some sense the bargain here is that you are giving up some flexibility in the kind of functions that's kind of code you can write to win all of these other benefits that you know I don't we don't need to belabor here but there is a trade-off you can I can't kind of arbitrarily do whatever I want in some random function and reach into every variable and have these Global's and do all this other stuff so of course that might be very good reasons for not doing this but just saying that better tooling or better technology or GC is going to kind of eliminate this trade-off where I lose ultimate flexibility to make horrific mistakes but I gain all of this reliability and all this good stuff that that I don't see the logic or the necessarily the reasoning here that's going to sell that and the question then you have to ask is these trade-offs of losing the flexibility now in order to gain the reliability and clarity and composability benefits later in the democratized world of production izing your jupiter notebook and things like this is that the trade-off that people are going to pursue or are they going to say no i want the ultimate flexibility and i'm not really going to worry that much about the later consequences and this you know these kind of governing dynamics of iterating fast and not having to you know necessarily think about how I want my code to be factored out or my datatypes to be defined and things like this these are the concerns of kind of a next level and I don't think we have it thank you David we'll be late so Oscar the stage is yours I agree with my colleagues here that I think you have to you have to vote for us unless you feel that the future is like one of like stagnation you know this side says we can't make better tools this I says today data scientists like to use Python this morning and I don't see I think Ajit said and I don't I don't see that changing right now but our debate is about the future and we're not arguing whether you don't have to agree with us that like today people like Python you look to vote for us they like Python today what we say is that it's going to get easier you're gonna stop writing your logistic regression you're gonna call a pure function takes some data and spits out the model and that's a perfectly nice pure function if you believe that's gonna happen vote for us if you believe deep learning is gonna be a black box behind which you will throw again here's some data and out will Papa model vote for us if you believe a model where I throw data at it and out pops a prediction is a pure function vote for us okay awesome thank you like everyone please give a huge round of applause for our wonderful debaters okay so now in order to determine one the system will be that is the team that was able to sway the most votes so since the team arguing against the proposition did not have too many votes going for it at the beginning let's again vote who is against the proposition that functional programming is the feature of ML please raise your hands okay awesome so it looks fairly similar and who is now a for the proposition that function programming is the future of ml okay Linda Jenna I think we have a winner here the team arguing for the proposition round of applause [Applause] [Music]