Comments (3)
Hi Alex,
The units of window_length
is integration time, not data points. However, it turns out that in practice these two things should nearly always be the same thing. (See below.)
So your example code is correct. In what you've written, it is always 4 points, regardless of what times they correspond to. This is usually the desired behaviour. If you really want something different then you can use the t
argument to logsig_windows
. (Whose use might be clearer after the explanation below.)
Aside: whether passing t
like this will improve/decrease performance of a model, I don't know. In the theoretical limit they end up being the same thing -- i.e. the choice doesn't matter -- but I can completely believe that the numerical error in the differential equation solver will affect each case differently. Try it and find out?
For completeness -- this is easily one of the most confusing aspects of working with neural CDEs. There are up to three different notions of time that may be considered:
- Observation times, i.e. the actual raw
t
in "the temperature wasx=20°
at timet=midday
". These should be appended to the data (x
in your example) and then forgotten about. So what you're doing is correct in this regard. - Integration time, which is the region of time integrated over in the solver. This is essentially an arbitrary choice, by reparameterisation invariance. Because it's arbitrary, it's an optional
t=None
argument for functions likelogsig_windows
, in which case it just defaults to an arithmetic sequence0, 1, 2, ...
. So again what you're doing is correct in this regard. (And it is this thatwindow_size
is with respect to.) If I was making this library again I'd probably just remove theset
options entirely to avoid the confusion, as they're used so little. - Data points. That is, the
i
for counting your datax_0, x_1, x_2, ... x_i, ...
. This is always just the values0, 1, 2, ...
, so it will typically coincide with the integration time.
Does that make sense?
It's true that the documentation for logsig_windows
(and for the above notions of time) could probably afford to be clearer. If you have any specific suggestions I'd be open to feedback / PRs.
from torchcde.
Thanks Patrick.
In that case, after applying logsig_windows I can use a fixed step solver with step size 1.0 correct?
X = torchcde.NaturalCubicSpline(train_coeffs)
X0 = X.evaluate(X.interval[0])
z0 = self.initial(X0)
zT = torchcde.cdeint(X=X,z0=z0,func=self.func,t=X.interval,method='rk4',options=dict(step_size=1.0))
Because the logsig will renormalize the observation times from raw data to just arithmetic sequence?
from torchcde.
Actually, you can use step_size=1.0
even without that. NaturalCubicSpline
by default takes the integration time to be an arithmetic sequence.
I think you've got this now, but for the sake of any future readers:
- Generally the correct thing to do is to append observation times to your data, and thereafter forget about time altogether. (With the one exception of setting step sizes.)
- There's nothing special about NCDEs in that regard. You do the same when processing sequences with RNNs.
from torchcde.
Related Issues (20)
- setup.py and torchsde HOT 1
- Breaking install HOT 4
- publish `torchcde` on PyPI HOT 1
- Consider opening a GH discussions HOT 13
- Online prediction tasks needs examples HOT 4
- About how to use on seq2seq works HOT 5
- Sequence outputs from Neural ODE (similar to 'many to many' RNN)? HOT 3
- CDEs with Image Data HOT 1
- Comparison to alternative ODE models HOT 4
- About how to use CDE in Variational Autoencoders? HOT 1
- Integration to pytorch lighting pipeline HOT 1
- piping in & predicting arbitrary streams of values
- Very slow training with market data, normal? HOT 1
- much slower when using torchsde as backend. HOT 2
- Integrate the ODE function of the CDE system to infinity HOT 2
- Please consider create conda distribution (maybe conda-forge?) HOT 1
- Prediction of irregular time series HOT 1
- Masking Coefficients? HOT 2
- Seq2seq forecasting: adding temporal information and extrapolation
- Overfitting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from torchcde.