-
Notifications
You must be signed in to change notification settings - Fork 105
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
Add indexing of DiscreteLp #1113
Comments
I see an upcoming issue here with vector- and tensor-valued functions. If we have a vector-valued function with 2 components (say a gradient in 2D), wouldn't we want In the face of this ambiguity it may be better to not implement |
Well I see no conflict here, one would simply expect a tensor valued function (say with rank
I guess this breaks my above code, but only in an obvious way. With that said adding your utilities would certainly be good. |
Changes in detail: - Add dtype with shape to DiscreteLp (mostly __repr__, factory functions and some downstream methods). As a consequence, `shape_[in,out]` and `ndim_[in,out]` are added for the different types of axes, as well as `scalar_dtype`. - Add `PerAxisWeighting` and make it the default for `DiscreteLp` type spaces. Reason: this way the `tspace` knows how to deal with removed axes etc. This is important for a smooth experience with indexing and reductions over axes. Helpers for slicing weightings help structure this task. - Implement `__getitem__` for `TensorSpace` and `DiscreteLp`, including (hopefully) reasonable propagation of weights. The new `simulate_slicing` utility function simplifies this task. - Allow indexing with ODL tensors of boolean or integer dtype. - Implement correct weighting for backprojections with non-uniform angles, using per-axis weighting and a new helper `adjoint_weightings` to apply the weightings in an efficient way. The correct weighting from the range of `RayTransform` is determined by the new `proj_space_weighting` helper. - Change the space `_*_impl` methods to always expect and return Numpy arrays, and adapt the calling code. - Change behavior of `norm` and `dist` to ignoring weights for `exponent=inf`, in accordance with math. - Improve speed of `all_equal` for comparison of arrays. - Account for `None` entries in indices in the `normalized_index_expression` helper, thus allowing creation of new axes. - Remove `dicsr_sequence_space`, it was largely unused and just a maintenance burden. Use a regular `uniform-discr` from zero to `shape` instead. - Remove `Weighting.equiv()` mehtods, never used and hard to maintain (n^2 possibilities). - Remove the (largely useless) `_weighting` helper to create weighting instances since it would have been ambiguous with sequences of scalars (array or per axis?). Also remove the `npy_weighted_*` functions, they were useless, too. - Remove some dead code from tomo/util. - A bunch of minor fixes, as usual. Closes: odlgroup#908, odlgroup#907, odlgroup#1113, odlgroup#965, odlgroup#286, odlgroup#267, odlgroup#1001
Changes in detail: - Add dtype with shape to DiscreteLp (mostly __repr__, factory functions and some downstream methods). As a consequence, `shape_[in,out]` and `ndim_[in,out]` are added for the different types of axes, as well as `scalar_dtype`. - Add `PerAxisWeighting` and make it the default for `DiscreteLp` type spaces. Reason: this way the `tspace` knows how to deal with removed axes etc. This is important for a smooth experience with indexing and reductions over axes. Helpers for slicing weightings help structure this task. - Implement `__getitem__` for `TensorSpace` and `DiscreteLp`, including (hopefully) reasonable propagation of weights. The new `simulate_slicing` utility function simplifies this task. - Allow indexing with ODL tensors of boolean or integer dtype. - Implement correct weighting for backprojections with non-uniform angles, using per-axis weighting and a new helper `adjoint_weightings` to apply the weightings in an efficient way. The correct weighting from the range of `RayTransform` is determined by the new `proj_space_weighting` helper. - Change the space `_*_impl` methods to always expect and return Numpy arrays, and adapt the calling code. - Change behavior of `norm` and `dist` to ignoring weights for `exponent=inf`, in accordance with math. - Improve speed of `all_equal` for comparison of arrays. - Account for `None` entries in indices in the `normalized_index_expression` helper, thus allowing creation of new axes. - Remove `dicsr_sequence_space`, it was largely unused and just a maintenance burden. Use a regular `uniform-discr` from zero to `shape` instead. - Remove `Weighting.equiv()` mehtods, never used and hard to maintain (n^2 possibilities). - Remove the (largely useless) `_weighting` helper to create weighting instances since it would have been ambiguous with sequences of scalars (array or per axis?). Also remove the `npy_weighted_*` functions, they were useless, too. - Remove some dead code from tomo/util. - A bunch of minor fixes, as usual. Closes: odlgroup#908 Closes: odlgroup#907 Closes: odlgroup#1113 Closes: odlgroup#965 Closes: odlgroup#286 Closes: odlgroup#267 Closes: odlgroup#1001
Changes in detail: - Add dtype with shape to DiscreteLp (mostly __repr__, factory functions and some downstream methods). As a consequence, `shape_[in,out]` and `ndim_[in,out]` are added for the different types of axes, as well as `scalar_dtype`. - Add `PerAxisWeighting` and make it the default for `DiscreteLp` type spaces. Reason: this way the `tspace` knows how to deal with removed axes etc. This is important for a smooth experience with indexing and reductions over axes. Helpers for slicing weightings help structure this task. - Implement `__getitem__` for `TensorSpace` and `DiscreteLp`, including (hopefully) reasonable propagation of weights. The new `simulate_slicing` utility function simplifies this task. - Allow indexing with ODL tensors of boolean or integer dtype. - Implement correct weighting for backprojections with non-uniform angles, using per-axis weighting and a new helper `adjoint_weightings` to apply the weightings in an efficient way. The correct weighting from the range of `RayTransform` is determined by the new `proj_space_weighting` helper. - Change the space `_*_impl` methods to always expect and return Numpy arrays, and adapt the calling code. - Change behavior of `norm` and `dist` to ignoring weights for `exponent=inf`, in accordance with math. - Improve speed of `all_equal` for comparison of arrays. - Account for `None` entries in indices in the `normalized_index_expression` helper, thus allowing creation of new axes. - Remove `dicsr_sequence_space`, it was largely unused and just a maintenance burden. Use a regular `uniform-discr` from zero to `shape` instead. - Remove `Weighting.equiv()` mehtods, never used and hard to maintain (n^2 possibilities). - Remove the (largely useless) `_weighting` helper to create weighting instances since it would have been ambiguous with sequences of scalars (array or per axis?). Also remove the `npy_weighted_*` functions, they were useless, too. - Remove some dead code from tomo/util. - A bunch of minor fixes, as usual. Closes: odlgroup#908 Closes: odlgroup#907 Closes: odlgroup#1113 Closes: odlgroup#965 Closes: odlgroup#286 Closes: odlgroup#267 Closes: odlgroup#1001
Changes in detail: - Add dtype with shape to DiscreteLp (mostly __repr__, factory functions and some downstream methods). As a consequence, `shape_[in,out]` and `ndim_[in,out]` are added for the different types of axes, as well as `scalar_dtype`. - Add `PerAxisWeighting` and make it the default for `DiscreteLp` type spaces. Reason: this way the `tspace` knows how to deal with removed axes etc. This is important for a smooth experience with indexing and reductions over axes. Helpers for slicing weightings help structure this task. - Implement `__getitem__` for `TensorSpace` and `DiscreteLp`, including (hopefully) reasonable propagation of weights. The new `simulate_slicing` utility function simplifies this task. - Allow indexing with ODL tensors of boolean or integer dtype. - Implement correct weighting for backprojections with non-uniform angles, using per-axis weighting and a new helper `adjoint_weightings` to apply the weightings in an efficient way. The correct weighting from the range of `RayTransform` is determined by the new `proj_space_weighting` helper. - Change the space `_*_impl` methods to always expect and return Numpy arrays, and adapt the calling code. - Change behavior of `norm` and `dist` to ignoring weights for `exponent=inf`, in accordance with math. - Improve speed of `all_equal` for comparison of arrays. - Account for `None` entries in indices in the `normalized_index_expression` helper, thus allowing creation of new axes. - Remove `dicsr_sequence_space`, it was largely unused and just a maintenance burden. Use a regular `uniform-discr` from zero to `shape` instead. - Remove `Weighting.equiv()` mehtods, never used and hard to maintain (n^2 possibilities). - Remove the (largely useless) `_weighting` helper to create weighting instances since it would have been ambiguous with sequences of scalars (array or per axis?). Also remove the `npy_weighted_*` functions, they were useless, too. - Remove some dead code from tomo/util. - A bunch of minor fixes, as usual. Closes: odlgroup#908 Closes: odlgroup#907 Closes: odlgroup#1113 Closes: odlgroup#965 Closes: odlgroup#286 Closes: odlgroup#267 Closes: odlgroup#1001
DiscreteLp
should be indexable like geometries, according to the rule:The text was updated successfully, but these errors were encountered: