6 ms·
NOPE. Never do this ever. Never in production and never in pre-production. Never do this. Warning: Here be dragons. Never create anything people rely on that
by suff 7y ago
NOPE. Never do this ever. Never in production and never in pre-production. Never do this.
Warning: Here be dragons.
Never create anything people rely on that runs machine learning in PHP.
- andrewdalpino 7y agoHaha yeah that's a common reaction from people that haven't seen it with their own eyes yet I don't blame you Let me know if you have any questions
- suff 7y agoI mean, it's not that it won't work, but why would you use a language that is a CPU hog, for a heavy duty task that needs a GPU? It's 2 orders of magnitude slower than it needs to be, and nobody else has ever trained or done tutorials for PHP ML, so why? Just why?? Respect for building fundamentals, but in terms of utility, it needs a proper warning label IMHO.
- andrewdalpino 7y agoThis is a good convo to have Two things you mentioned that are incorrect though The first is the presumption that you need a GPU to do machine learning - the reality is that the average business doesn't need nor has the data to benefit from such large models The second is that PHP is slow - but when you do comparisons with Python, PHP is actually faster https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/php.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... The reason why Python, for example, is faster in some machine learning applications is because it's probably getting help from a library such as numPY or Tensorflow Although these tools are missing currently in the PHP ecosystem, I'm confident that we'll have them eventually For example, here is an attempt to bring numPY-like functionality as a PHP extension https://github.com/phpsci/phpsci-ext/tree/1.0-dev https://github.com/phpsci/phpsci-ext/tree/1.0-dev We've also had some progress being made accessing Tensorflow from PHP using an FFI (foreign function interface) https://github.com/dstogov/php-tensorflow https://github.com/dstogov/php-tensorflow So this is where the convo should begin in my opinion
- suff 7y agoIf you're going to do it at all, I agree, integration with GPU enabled libraries is a must. Even so, I could use DLLImport in VBA, and get access to Tensorflow from an Excel macro. I would say the same thing: you can get a dog to walk on two legs, but that's not what it was meant to do. 'Can' and 'should' are world's apart.
- andrewdalpino 7y agoWhat languages do you program in? I've used PHP for a while now. PHP is a language that favors practicality. It's a language that is depended on throughout the world and doesn't (purposely) change as fast to accommodate new trends Having that said - The value of machine learning has become very clear over the past decade or so - 80% of websites on the web are powered by PHP https://haydenjames.io/80-percent-web-powered-by-php/ https://haydenjames.io/80-percent-web-powered-by-php/ I undoubtedly anticipate a steady rise in effort from the PHP community directed at practical applications of ML - Rubix ML being one of the first libraries to make these tools accessible to the PHP engineer
- suff 7y agoI write in all kinds of languages. Just because Wordpress generates it, doesn't make it a best practice. Do you think Wordpress websites are the best? It's definitely not the most popular language: https://github.com/emmanuel-keller/github-language-statistics https://github.com/emmanuel-keller/github-language-statistic... https://www.tiobe.com/tiobe-index https://www.tiobe.com/tiobe-index https://redmonk.com/sogrady/2019/03/20/language-rankings-1-19 https://redmonk.com/sogrady/2019/03/20/language-rankings-1-1... PHP is falling because it has major issues. It has poor idioms and is slow. It is trending down, not up.