-
Notifications
You must be signed in to change notification settings - Fork 34
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
Clarify behaviour/documentation of transform() #217
Comments
This is a really good point. I agree that going for more verbosity by renaming to
Hmmm this is an interesting point. Would you prefer to disallow this default in favour of insisting that the more verbose version is used? (I could live with that, and I agree that it might be clearer). Moreover, I agree that a |
It seems it would be sufficient to define |
Agreed, but in general I really dislike doing the looks-like-a-constructor-but-isn't thing as I find it misleading. so would prefer that we either
edit: or |
Or we can go back to the idea of the macro :D . For example having a |
I guess? It just seems to me that it's no easier / clearer to write |
I think we are all super biased right now 😅😅😅 |
I think the name |
@devmotion More seriously, for me the advantage of a macro is that it allows more liberties for making a convenient API: I really see it as an API for new users/beginners who just want to get their RBF: |
I am still not convinced 😄 😄 I agree that it is a bit cumbersome to create a kernel with lengthscale currently - but I think the also I get the impression that maybe, as suggested above, we should just add a function that adds a lengthscale transformation to the inputs. Basically it would be defined as with_lengthscale(kernel::Kernel, l::Real) = transform(kernel, inv(l)) I am not sure about the name (I guess it should be both explicit and compact enough), @willtebbutt's suggestion above was
|
That's it you convinced me! I am on board with |
|
Ok then I'll close the everlasting macro PR #38 and make a new one for |
+1 on not-a-macro, |
And I'd retire the |
I get the sentiment of exactitude but |
Maybe just |
For me |
To continue with my silly propositions: an additional possible syntax would be |
As an outsider who is interested in using GPs with Julia I thought @theogf's last proposal is excellent: concise, memorable and does not pollute the namespace. I tried overloading Edit: it might be clearer to change the name of "transform(::Kernel, ::Transformation)". The above behaviour felt very counterintuitive when I stumbled upon it... |
Making this change in favour of composition would also help with some name clashes. |
The composition is awesome but we should still have a verbose approach, we should not rely solely on a Unicode character! Maybe |
Julia maintainers didn't like If we still want to go with it we should not define our own |
There is probably some matter of "getting used to it", but for a user new to this package, having to specify the inverse lengthscale seems deeply unintuitive compared to other GP packages.
At least
transform(k, ScaleTransform(2.0))
is still explicitly saying what it is (and there could be aLengthscaleTransform()
that divides instead of multiplying...), but I think it is not very helpful to new users thattransform(k, 2.0)
will give you a kernel with lengthscale 0.5.Moreover, the syntax
TransformedKernel(kernel, ...)
suggests to me that the transform is changing something about the kernel, rather than about the inputs. (And ScaleTransform on inputs vs ScaledKernel on outputs is somewhat ambiguous/confusing as well.) If not just renaming it to the more verboseinput_transform
or similar, what other ways could we clarify what is actually going on here?Comment from @willtebbutt:
(Also, would be good to document/demonstrate how to be able to set bijectors on parameters within this framework. Should that be a separate issue?)
Originally posted by @st-- in #213 (comment)
The text was updated successfully, but these errors were encountered: