4 ms·
How do you differentiate a string? Enum?
by potbelly83 5y ago
How do you differentiate a string? Enum?
- adgjlsfhk1 5y agogenerally you consider them to be piecewise constant.
- tome 5y agoOr more precisely, discrete.
- titanomachy 5y agoIf you were dealing with e.g. English words rather than arbitrary strings, one approach would be to treat each word as a point in n-dimensional space. Then you can use continuous (and differentiable) functions to output into that space.
- 6gvONxR4sf7o 5y agoThe answer to that is a huge part of the NLP field. The current answer is that you break down the string into constituent parts and map each of them into a high dimensional space. “cat” becomes a large vector whose position is continuous and therefore differentiable. “the cat” probably becomes a pair of vectors.
- nerdponx 5y agoIt's weirder than that. You typically are differentiating a loss function of strings and various opaque weights. You are optimizing the loss function over the weight space, so in some informal contrived sense you are actually differentiating with respect to the string.
- geysersam 5y agoNot all functions are differentiable. Sometimes there are other better ways to describe "how does changing x affect y". Derivatives are powerful but they are not the only possible description of such relationships. I'm very excited for what other things future "compilers" will be able to do to programs besides differentiation. That's just the beginning.
- bmc7505 4y agohttps://en.wikipedia.org/wiki/Brzozowski_derivative https://en.wikipedia.org/wiki/Brzozowski_derivative