-
Notifications
You must be signed in to change notification settings - Fork 42
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
Encoded DeepGPs. #873
Encoded DeepGPs. #873
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Couple of very minor questions
@@ -96,7 +97,9 @@ def sample(self, at: TensorType, *, jitter: float = DEFAULTS.JITTER) -> TensorTy | |||
tf.debugging.assert_shapes([(at, [..., 1, None])]) | |||
tf.debugging.assert_greater_equal(jitter, 0.0) | |||
|
|||
samples = tf.repeat(at[..., None, :, :], self._sample_size, axis=-3) # [..., S, 1, D] | |||
samples = tf.repeat( | |||
self._encode(at[..., None, :, :]), self._sample_size, axis=-3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason not to encode first thing?
at = self._encode(at)
samples = tf.repeat(at[..., None, :, :], self._sample_size, axis=-3) # [..., S, 1, D]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly compactness.
@@ -72,6 +72,7 @@ def __init__(self, sample_size: int, model: GPfluxPredictor): | |||
) | |||
for _ in range(len(self._model_gpflux.f_layers)) | |||
] | |||
self._encode = lambda x: model.encode(x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity, does the following work?
self._encode = lambda x: model.encode(x) | |
self._encode = model.encode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I think it does.
Related issue(s)/PRs:
Summary
Add support for encoding to Deep GPs models.
Fully backwards compatible: yes
PR checklist