Skip to content

support nd states #67

@martinjrobins

Description

@martinjrobins
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions