5 ms·
That's a whole lot of work for a result that's indistinguishable from a Markov chain generator..
by Mizza 8y ago
That's a whole lot of work for a result that's indistinguishable from a Markov chain generator..
- KenoFischer 8y agoSure, the point is 1. To use a small dataset that can be fed from the relatively small Colab VM (so people can play with it themselves) 2. To use a well known model (so people can focus on the implementation parts of it) There's a resnet example in the previous example in the series (though the dataset is too large to feed from Colab). Also, this is very early stage software, so things are a bit more verbose than they should be :).
- dnautics 8y agoAm I mistaken that this is interesting (and possibly also complex) because it's using the TensorFlow (out of julia) library to leverage the TPUs, while the actual ML algo is implemented in Flux, a library which has no TPU support?
- KenoFischer 8y agoThere's very little TensorFlow here. We're using it as a glorified grpc client basically to ship XLA to the TPU. The actual mechanism is described in https://arxiv.org/abs/1810.09868 https://arxiv.org/abs/1810.09868. The model definition itself uses the layers from Flux, but there's a couple assumptions that Flux makes that don't hold for the TPU so we don't get to use everything from Flux (e.g. the training loop and the optimizers). Luckily everything is julia, so we can get TPU-compatiable versions in just a few lines of code. Unifying the abstractions is an active work in progress, but this shows off that Julia runs on TPUs at all (an on freely available, public infrastructure at that), which is pretty cool, because right now the only other TPU frontend that can say the same is TensorFlow (which had a bit of a head start ;).
- marmaduke 8y agoNot to detract from Julia, but I’ve always found it odd that Julia users report that “Julia runs on X” when in fact it’s more that one can use X from Julia or generate code for X by rewriting Julia code. By analogy, and contrast, no one says Python runs on GPUs, just because TensorFlow allows describing models in Python that then get run on the GPU, or Numba rewrites Python loops to CUDA PTX. It looks like marketing tbh despite know that Julia is a very solid language technically and shouldn’t need these kinds of rhetorical tricks.
- KenoFischer 8y agoSo to me the biggest semantic question are the following: - Does what you have to write to run on X follow the semantics of the language? - Can you use data structures/code defined in libraries that don't know about your thing? In the case of julia on TPU here, the answer is yes! (surprisingly perhaps, and getting this to work is pretty hard). In particular, you get a lot of julia's language features: Multiple dispatch, control flow, etc. It's a bit of a subset of the full language (e.g. no mutation at the moment), but everything that's supported is just standard julia and we're working on growing that subset more and more. That approach is very different from something like TensorFlow where you're essentially metaprogramming an expression graph. Numba probably counts for python (yeah, you have to put an annotation on things, but if the python people really wanted, they could probably import Numba into core cpython and make it work more smoothly). Of course in python, you have the additional complication that most of the core implementation is not in python itself, so even if you satisfy my two criteria above for the core language, you're still gonna have to rewrite the whole standard library.
- skybrian 8y agoIt's a nice demo, but reusing Julia libraries not intended for TensorFlow seems like a fragile thing? Just because it works today doesn't mean the authors won't inadvertently break it by using something outside the portable subset. It seems like for non-demo usage, you would want upstream maintainers to agree that their code should be TensorFlow-compatible, and have tests keeping it working.
- minimaxir 8y agoIt depends on the dataset. Char-RNNs do pretty well compared to Markov chains when used to generate smaller texts. (which is why I've become less of a fan of the Shakespeare example the original Karpathy post used).
- jefftk 8y ago> indistinguishable from a Markov chain generator A Markov chain generator wouldn't: * Capitalize the first word of each line * Make lines of approximately the right length * Mark text with who is to speak it While this is just a toy example, it's powerful enough to start showing the ways RNNs can produce text that looks superficially correct. (Generating Shakespeare is actually one of the examples given in the classic http://karpathy.github.io/2015/05/21/rnn-effectiveness/ http://karpathy.github.io/2015/05/21/rnn-effectiveness/)
- AstralStorm 8y agoYou're mistaking a Markov chain toy with an actual Markov chain generator. 1. Yes it would. It would see capitalized words as high probability for first word on a line or after a point. 2. Obviously it could, depending on stop condition. Especially if you include line length. 3. If trained on corpus of plays, for sure it would. The strength on the RNN is supposed to be in context and memory... Perhaps handling of grammar. There are advanced hierarchical grammars that are related to Markov random field models that are about on par with RNN based on many text and music analysis loads. (In fact probabilistic math is often used to describe results and workings of a deep NN anyway.)
- mopeloi 8y agoI had a similar experience trying to use an LSTM model / TensorFlow based on the Shakespeare RNN example. This doesn't generate novel, meaningful text content without a template, but I'm unaware of any machine learning model that does this well (OpenAI's included). This model does absorb the 'rules' of the text, both grammar and structure (character names and dialogue, scene introductions, etc) In my own project, I made use of this to find spelling and grammatical errors on Esperanto Wikipedia: https://medium.com/@mapmeld/esperanto-nlp-part-3-correcting-grammar-6d34f93bded1 https://medium.com/@mapmeld/esperanto-nlp-part-3-correcting-...