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

how to set points_per_unit #5

Open
dialuser opened this issue Jul 24, 2022 · 4 comments
Open

how to set points_per_unit #5

dialuser opened this issue Jul 24, 2022 · 4 comments

Comments

@dialuser
Copy link

Hi,

I'm trying to figure out how to set the points_per_unit parameter. In my case, the original time span of time series is 18 years and the frequency is 5 days. I first scaled the whole time span to [-2, 2] to be compatible with the example ConvCNP implementation. This means each unit corresponds to 18/4 years. So points_per_unit should be (365 days / 5 day)*18/4 = 328.5. Is this right? Is it possible to make this integral scale learnable?

Thanks,
Alex

@wesselb
Copy link
Member

wesselb commented Jul 27, 2022

Hey Alex!

Our recommendation is to determine the "smallest wiggle" in your data that you want to model,
and to set 1 / points_per_unit to at most half that length scale or smaller. If you have a data point every 5 days, then, if the units of the inputs are in days, you could try points_per_unit = 2 / 5 or higher. Typically a higher points per unit yields better results, though it is also more computationally expensive. (For example, for a Gaussian process with a length scale of 0.25, points_per_unit = 2 / 0.25 = 8 should be the minimum. In the experiments in the paper, we use points_per_unit = 32 or even points_per_unit = 64.)

If your time series is equally spaced, you might want to consider the on-the-grid version of the model.

Is it possible to make this integral scale learnable?

I'm not sure if it is possible to make points_per_unit learnable. That would be very interesting though!

Please let us know if you manage to get things to work. :)

@dialuser
Copy link
Author

Hi
I guess a fundamental issue is I didn't fully understand the notion of context points in time series forecast problems. In time series forecasting, the time domain is semi-infinite. So what's the meaning of x_range (e.g., (-1,1)) in this case? How do I incorporate the moving window concept here? This is not the typical extrapolation problem mentioned in the examples.

Thanks,
Alex

@wesselb
Copy link
Member

wesselb commented Jul 29, 2022

Hey Alex,

I’m currently on holidays and don’t have access to a laptop. If you wouldn’t mind, I might get back to this issue when I’m back to work. :)

@wesselb
Copy link
Member

wesselb commented Aug 9, 2022

Hey Alex,

I've just returned from holidays. I'm not sure how familiar you are with the method and the terminology, but let me have an attempt at explaining what is going on.

In a time series problem, the ConvCNP provides a mechanism to take in a some data points and make predictions at other inputs. The data points that are taken in are called the context set and the points that we're predicting at are called the target set. Even though in a time series problem the domain can be arbitrarily large, for a fixed target and context set, the time range spanned is finite.

Internally in the ConvCNP, the model computes the most extremal inputs of the context and target points, thus computing the domain that this particular data spans, and then computes a discretisation at a specified density (the points per unit) spanning this domain. This discretisation is recomputed for every combination of context and target set. The resolution of this discretisation, which is controlled by points per unit, determines the how quickly the predictions of the ConvCNP can wiggle.

x_range is a property of some synthetic data generator which can be used to train a ConvCNP. Of course, other sources of data can be used. For this particular data generator, x_range determines the range of the generated context and target points. x_range is therefore do to with data generation and not with the model.

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

2 participants