Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decouple flattening and transformations #13

Open
2 tasks
tpapp opened this issue Sep 2, 2018 · 5 comments
Open
2 tasks

decouple flattening and transformations #13

tpapp opened this issue Sep 2, 2018 · 5 comments

Comments

@tpapp
Copy link
Owner

tpapp commented Sep 2, 2018

Use separate building blocks for

  1. splitting a vector into arrays (or other objects) of various sizes and dimensions, without transforming,
  2. transformations.

Transformations should

  1. have a dimension,
  2. be able to perform log Jacobian calculations,
  3. carry information (schemas, see below) that allows flattening and unflattening their arguments (ignoring extra payload, especially for user-defined transformations).

Transformations should be generic, eg going from StaticArray should also produce StaticArray.

Flattening/unflattening should use schemas, possibly nested.

  1. make this work, define API.
  2. see what's optimizable.
@tpapp
Copy link
Owner Author

tpapp commented Sep 2, 2018

@tpapp tpapp mentioned this issue Sep 3, 2018
@tpapp
Copy link
Owner Author

tpapp commented Mar 10, 2019

@tkf
Copy link
Contributor

tkf commented Jun 22, 2019

Forgive me to suddenly drop a slightly ad-like comment here. I just thought it could be a useful information.

For nested (especially immutable) objects, I think Lens API from Setfield.jl is worth considering. Setfield.jl itself has no direct support for flattening (by that, I mean getting/setting multiple fields together) but I just created a package (Kaleido.jl) that does that. It also has a basic interop for TransformVariables.jl.

Setfield.jl/Kaleido.jl lack in-place operations at the moment so I guess it's probably not possible to directly cover all use-cases in TransformVariables.jl. But I think it is possible to implement "impure" lenses. See also jw3126/Setfield.jl#32

@tpapp
Copy link
Owner Author

tpapp commented Jun 22, 2019

@tkf: I appreciate the heads-up. I like your packages very much and I will look at Kaleido.jl.

@tpapp
Copy link
Owner Author

tpapp commented Oct 21, 2019

Another package for this is https://github.com/oschulz/ValueShapes.jl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants