Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename DoesNotExist #262

Closed
oxinabox opened this issue Dec 14, 2020 · 7 comments
Closed

Rename DoesNotExist #262

oxinabox opened this issue Dec 14, 2020 · 7 comments

Comments

@oxinabox
Copy link
Member

oxinabox commented Dec 14, 2020

I hate the name DoesNotExist.
To me 1st year calculs said things like "The derivative does not exist when the derivative when taking the limit from the left is not equal to the dervative when taking the limit from the right".
But infact for that case we often return Zero by the subgradient convention -- since it is a potential local minima.

What we use DoesNotExist to signify is that: "perturbing this value is not well-defined, or would result in the primal program throwing an error"
Which is for things like the integer index in getindex or for Strings.
I think we should rename it to something like NoTangentSpace or NonPerturbable.

I like of like CanNotLinearize() but that is actually applicable for the limit from left != limit from right case.

It looks like DexLang calls this Discrete

@mzgubic
Copy link
Member

mzgubic commented Dec 15, 2020

I don't hate it enough to change it, but agree a different name would be better. I like Discrete or NonPerturbable, but writing NonPerturbable is a pain, so maybe my vote goes to Discrete. NoTangentSpace is potentially confusing to beginners, whereas Discrete is obvious to anyone.

@nickrobinson251
Copy link
Contributor

Discrete would clash with Distributions.Discrete, in case we care about that.

@nickrobinson251
Copy link
Contributor

  • WhatWouldThisEvenMean
  • DoesNotMakeSense
  • NotWellDefined
  • Nah

@nickrobinson251
Copy link
Contributor

xref: #305

@sethaxen
Copy link
Member

sethaxen commented Apr 4, 2021

A point against Discrete is that it is the primal that is discrete, not the differential.

Because discrete spaces form 0-dimensional manifolds, then the tangent space (if it exists, not sure if it formally does) contains only the zero vector. So from this perspective Zero would be fine. Is the goal for this differential to behave in some way differently from Zero, or is the goal to encode in this differential the reason why it is zero?

@oxinabox
Copy link
Member Author

oxinabox commented Apr 6, 2021

#305 suggests calling this NoPossibleTangent
because #305 would suffix all AbstractDifferentials with the suffix Tangent

Is the goal for this differential to behave in some way differently from Zero, or is the goal to encode in this differential the reason why it is zero?

In theory it might be nice for it to error if it is ever used (I.e. if it was ever added to a primal value).
Main reason it doesn't right now is because it wouldn't give a helpful error message.
A proposal exists to replace it wioth a macro that records where it was created, and the stacktrace to that point.

I like the difference between DoesNotExist and Zero is that if your primal output is discrete (like a bool) then it's differential will be Zero (almost everywhere), e.g. from sign or from =>.
If your primal input is descrete then its differential is DoesNotExist. (like input to getindex)

@mzgubic
Copy link
Member

mzgubic commented Jun 23, 2021

done in #353

@mzgubic mzgubic closed this as completed Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants