You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The state tensor u should be generalisable to a nd-tensor, but I've only really tested it as a 1d vector, need to add tests to make sure nd works ok. The state tensor u should still be fully dense
once I'm happy with u as an nd-tensor, adding im2col and col2im functions would be useful for convolution operations. could restrict this to dense inputs/outputs. Note, actually this isn't as good since you do it on the state which changes at each iteration, you want to do the operation of the kernel which doesn't change, so k2sp is a preference
also add k2sp as a function to transform a constant (non time depenent but could be param dependent) nd sparse/dense kernel to a 2d sparse matrix for matrix vector multiplications ala finite difference. I'm not sure how to do this for nd, so might have to specialise for each dimension: 1, 2, 3 and fail for d > 3.
Would also need operators to construct initial conditions, should be able to use indices in expressions e.g. x_i {(0:20): i / 20.0 }
and define constant integers for repeated use: int N = 20 x_i { (0:N): i / N }
or could just fuse im2col, matmul, then col2im as a single function conv, i.e. a_ij { conv(k_ab, b_ij) } or a_ij { k_ab ⊗ b_ij. The conv has various meta-parameters, e.g. padding, not sure how to include these
ushould be generalisable to a nd-tensor, but I've only really tested it as a 1d vector, need to add tests to make sure nd works ok. The state tensorushould still be fully denseuas an nd-tensor, addingim2colandcol2imfunctions would be useful for convolution operations. could restrict this to dense inputs/outputs. Note, actually this isn't as good since you do it on the state which changes at each iteration, you want to do the operation of the kernel which doesn't change, sok2spis a preferencek2spas a function to transform a constant (non time depenent but could be param dependent) nd sparse/dense kernel to a 2d sparse matrix for matrix vector multiplications ala finite difference. I'm not sure how to do this for nd, so might have to specialise for each dimension: 1, 2, 3 and fail for d > 3.im2col, matmul, thencol2imas a single functionconv, i.e.a_ij { conv(k_ab, b_ij) }ora_ij { k_ab ⊗ b_ij. The conv has various meta-parameters, e.g. padding, not sure how to include these