Closed turmeric-blend closed 3 years ago
I would say it depends. More than anything, the middle dimensions is the one that we compute the sample covariance matrix over. So maybe more neutral name like dim
would be more fitting.
The reason why it depends is that we do not really know what kind of layers came before the CovarianceMatrix
layer. The only thing that is fixed in deepdow
is that the input tensor X
has a shape (n_samples, n_channels, lookback, n_assets)
. What happens after is up to the user to decide.
See below two valid architectures and note that for each of them the middle dimension has a different meaning.
1.
(n_samples, n_channels, lookback, n_assets)
-- average over the channel dimension -- > (n_samples, lookback, n_assets)
-- CovarianceMatrix
--> (n_samples, n_assets, n_assets)
...
2.
(n_samples, n_channels, lookback, n_assets)
-- average over the lookback dimension -- > (n_samples, n_channels, n_assets)
-- CovarianceMatrix
--> (n_samples, n_assets, n_assets)
...
ah ok thanks.
reopen just to act as a reminder to fix this perhaps
https://github.com/jankrepl/deepdow/blob/cab9cac9d9212dd839951f65a9c0b49ca961eec7/deepdow/layers/misc.py#L69
I think this line for the
CovarianceMatrix
layer should be(n_samples, lookback, n_assets)
? Instead ofn_channels
.