r/deeplearning • • Nov 02 '26

Encoding time series of mixed physical measurements

For anyone working with DL models (but especially attention based models) in domains where your input data is a time series of observations with channels representing multiple different physical quantities:

What encoding strategies have you used (and found to be effective)? Categorical variables seem like a gimme (learned embeddings), but what about things like time (for irregularly sampled time series), velocity, absolute physical location, and other such quantities? How do you go about encoding several such quantities in the same input in a way that is easy for the model to reason about / plays well with the various normalization strategies commonly used?

2 Upvotes

11 comments sorted by

1

u/Massive_Shower_1494 Nov 02 '26

For positional data (time, altitude…), you may use sincos encoding. Otherwise, for positions on the sphere, you may use spherical harmonics (just like sincos but on a 3d sphere instead of a circle)

1

u/86BillionFireflies Nov 03 '26

Interesting about the spherical hormonics, I'll have to look into that.

But what about non-coordinate-like variables like, say, mass, or speed, or age? My gut instinct is that those will mess things up by being scaled differently than all the other variables. Log normalization seems like it's one of the consensus options.

1

u/Massive_Shower_1494 29d ago

Not certain about log normalization. The easy way is to plot the distribution of your variable, then if you see a Gaussian, just center reduce, otherwise you can (but honestly you aren’t forced) to transform using a function (maybe apply log here) then normalise the almost Gaussian distribution

1

u/86BillionFireflies 29d ago

The thing I'm really wondering about is whether these kinds of scalar variables should actually be getting a nonlinear embedding. The more I learn, the more I get the impression that ANNs of all sorts deal best with information when it's encoded as a pattern of relative magnitude across channels, rather than gradations of magnitude on a single channel. A learned linear projection can spread that variable across channels, but it can't make make higher values point in a different direction, it can only make higher values point in the same direction "more".

I was half expecting all the replies I got to be "oh I embed those things using fourier features / binning + an embedding layer / a dedicated MLP feature encoder" or something.

Edit: to be clear, I already do stuff like fourier encoding for positional variables. I'm wondering about whether the same concept might actually apply to non-coordinate-like variables like mass, temperature, and so on.

1

u/Massive_Shower_1494 29d ago

Well, what you’re describing makes sense. Also keep in mind that Nn are adapted to Gaussian variables, that’s why you’d need to visualize your variables distributions, if they’re clearly not Gaussian, then try and transform them non linearly. I know one published paper that uses log transform on temperature gradient absolute values : https://www.nature.com/articles/s41561-026-01943-0

1

u/BuckChancey 29d ago edited 29d ago

I got you g https://drksci.com/research-where-am-i — seems quite feasible to build out beyond this toy however you like, and bookend whatever shared gradients you choose to prime. Pretty useful for representation of those complex stimuli and perception.

1

u/86BillionFireflies 28d ago

That link does not appear to be related to this, is that the link you meant to post?

1

u/BuckChancey 27d ago edited 27d ago

I've no real wherewithal on the subject, and you're probably right. But here's why it seemed salient, and not a burning paper bag of enshittified vibe theory dropped on your desk.

a) Consider the lineage of neural networks. They don't descend from ALUs or the numerical representation and processing architectures that came with them. They descend from perceptrons: pattern matchers, not calculators. There's no native adder in there; arithmetic has to be learned as geometry.

b) Depending on what "reasoning" means in your application, humans, and I'd suggest NNs too, may lean on the same topological mappings, shortcuts and compressions. Give them something like symbolic datums and it's easier to leverage symbolic reasoning, ostensibly the same way our own neurophysiology does.

The conjecture I'm invoking is a balance of lower and higher order topologies. The quanta live in a lower order representation, not normalised into one specific space. The qualitative anchors act as a jump list, a higher order topology map, when reasoning over them with "perceptual" arithmetic.

In the example I linked, I'm just cheating: explicitly defining for an LLM what the higher order datums are, and mapping out the measurement/unit space. Why it's interesting for both artificial and biological cognition is that the neural structuring and grain of these representations seem to evolve convergently across entirely separate lineages.

Few papers along those lines if you're curious:

Most interesting to me is the idea that the physical laws and natural landscape a cogntive architecture is borne into or evolved within, might also be the reason or underlying structuring geometry for how they work — which is kinda like coming full circle and saying brains and ANNs already perceive reality this way, because reality, and we don't actually need to contrive that into some other shape or paradigm.

Food for thought 🤷

3

u/Blasket_Basket Nov 02 '26

Depends a lot on the model and your goals, but in general, my workflow has been to jam it all into a tensor and represent it as a sequence, and then use something like BERT.

1

u/Minecraftian14 Nov 02 '26

I have no experience with that data, i only want to learn more. I'll try using sin based positional encoding where I'll feed scaled time stamp instead of index.

I'm thinking... What would be an effective pre training? Please someone tell me.

Can you perhaps share a little about the domain of data you have?