3 ms·
I think the intended usage is not to find your whole program from example. Instead the programmer breaks the program down into simple operations, and uses this
by im3w1l 6y ago
I think the intended usage is not to find your whole program from example. Instead the programmer breaks the program down into simple operations, and uses this tool to remember what the name of that operation is. And finding short compositions is a bonus.
- YeGoblynQueenne 6y agoThere is certainly a lot of use that one can make out of a program with this kind of limitation, but it is a limitation- if it wasn't, there wouldn't be a warning about it in the article. In any case, if there was no such limitation most people here would be out of a job now, so it's an important limitation. >> And finding short compositions is a bonus. You mean because they can be easily inspected and debugged and edited by hand if required? If so, yes, I agree. But, for example, the algorithm I worked with, that I discuss above, a big criticism of the underlying technique has always been that _in practice_ it's limited to learning small programs.
- im3w1l 6y agoNo, I mean finding short compositions is a bonus feature over finding a single function from example.
- YeGoblynQueenne 6y agoOK, I don't understand what you mean. Can you explain?
- im3w1l 6y agoBeing able to find one_hot from input/output example is already useful, because you might skip over that name thinking it's some weird machine learning thing and you just want to set element values. You could easily lose an hour building and testing a solution based on stacking your desired indices with ranges and feeding it to scatter_nd.
- YeGoblynQueenne 6y agoI think I understand now, but just to be sure- you mean that being able to find expressions that do what you want fom examples of what you want, is a big bonus because it speeds up your programming? i.e. a sort of enhanced search function?
- im3w1l 6y agoYes exactly. But only for tensorflow. Not for programming languages in general.
- ghj 6y agoI can give another example use case. Say I know math but don't know tf api. I already know how to matrix multiply with `@` but don't know the function for matrix power. Then in theory it should be fairly quick for me to create a random matrix and feed it `mat @ mat`, `mat @ mat @ mat`, `mat @ mat @ mat @ mat`, etc until it spits out the correct tf function I should call for matrix_power. This is even better than googling since it guarantees that the function it found is correct for your example (googling returns tf.pow tf.exp tf.expm, none of which are actually what you want!)
- YeGoblynQueenne 6y agoThanks, I see what you two mean. It didn't occur to me that programming with tensors can be so challenging and I thought the authors just big it up a little to motivate the work - as one does :)
- ghj 6y agoIt's more that programming with math is hard. When communicating in mathematics you often assume the reader can understand precisely which mathematical object you're talking by extrapolating from ellipses "...". For example "the naturals are 1,2,3,4,..." or "the evens are 2,4,6,8,..." Or I might tell you a shift matrix is something that looks like: [0 1 0 0 0] [0 0 1 0 0] [0 0 0 1 0] [0 0 0 0 1] [0 0 0 0 0] And that single example with the suggestive naming should be enough for most people to understand what a shift matrix is for arbitrary size. But if you want to explain what a shift matrix is to a computer, you must use a formal definition (and to do it idiomatically you need to know esoteric details like that numpy.diagonal takes in an offset parameter so you can do something like https://stackoverflow.com/a/30230801 https://stackoverflow.com/a/30230801). It would be nice if we can talk math with a computer in the same intuitive language we use with humans, just give it a few examples and it will generate the the rest and let you double check the formula is correct. So I see stuff like tf-coder as a great step, not for synthesizing programs we don't know how to solve, but for language translation: between math notation and programming notation.
- 6y ago