NIFTy merge requestshttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests2021-08-16T17:53:00Zhttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/651WIP: Generalized matrix product and a fix in endomorphic MatrixProductOperator2021-08-16T17:53:00ZNeel ShahWIP: Generalized matrix product and a fix in endomorphic MatrixProductOperatorI added a linear matrix multiplication operator that generalizes the endomorphic MatrixProductOperator. The output matches that of the endomorphic operator in case of an endomorphic application.
The target domain/domain tuple of the val...I added a linear matrix multiplication operator that generalizes the endomorphic MatrixProductOperator. The output matches that of the endomorphic operator in case of an endomorphic application.
The target domain/domain tuple of the valid shape should be specified by the user, but I kept a standard RGSpace of the valid shape as the default.\
Below is an example of an application.
dtuple = DomainTuple.make(((RGSpace(10),RGSpace(20),RGSpace(30),RGSpace(40)))\
spaces = (1,3) (apply only to 2nd and 4th spaces of domain)\
matrix = np.ones(shape=(5,15,25,20,40))\
matop = GeneralMatrixProduct(dtuple,matrix,spaces,target=None)
According to the operator's convention,\
target_shape = (10,5,30,15,25)\
(since dtuple.shape = (10,20,30,40), the 20,40 axes are summed over, and to comply with the endomorphic MatrixProductOperator the 10,30 axes retain their positions and remaining axes of the matrix are filled in order)\
matop.target = DomainTuple.make(RGSpace(shape = target_shape, distances = default, harmonic = False))\
(unless a domain or DomainTuple with shape = target_shape is passed as the target)\
returns Field.from_raw(matop.target, np,tensordot of matrix and field summed over appropriate axes)
I tested the operator's working on the example above, and that it coincides with the endomorphic MatrixProductOperator when the latter is applicable. Would this be a useful operator, and what else in it can be tested or changed?
The second change is in the endomorphic MatrixProductOperator, I fixed its functionality for application to a >1 dimensional domain (say an RGSpace(shape=(5,15,25))). The previous version uses np.dot instead of np.tensordot, so due to default axis convention in np.dot it doesn't work when more than one axes are to be summed over. I don't think this was intentional because the operator doesn't throw an error until it is applied to a field over such a domain.
There is one last change in the docstring of the matrix product operator. It has a line saying `If DomainTuple it is assumed to have only one entry`, which I think is misleading because I can apply it to a domain tuple with many subspaces like the example above. I changed the line to `If Domain it is assumed to have only one subspace`, which is what I observed.
@gedenhof , can you have a look at this?https://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/650generate pages for NIFTy_7 branch2021-06-11T19:59:37ZMartin Reineckegenerate pages for NIFTy_7 branchhttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/648Work on vi visualized2021-06-10T20:07:18ZPhilipp FrankWork on vi visualizedhttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/646more text2021-06-10T10:51:48ZJakob Knollmuellermore textPhilipp Arrasparras@mpa-garching.mpg.dePhilipp Arrasparras@mpa-garching.mpg.dehttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/644polish and rename demo2021-06-10T10:13:20ZJakob Knollmuellerpolish and rename demoPhilipp Arrasparras@mpa-garching.mpg.dePhilipp Arrasparras@mpa-garching.mpg.dehttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/643Reproduce stdnormal samples2021-06-11T14:27:57ZPhilipp Arrasparras@mpa-garching.mpg.deReproduce stdnormal samplesMartin ReineckeMartin Reineckehttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/642testing successfull2021-06-09T15:10:47ZJakob Knollmuellertesting successfullhttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/641Test advi optim and parametric KL2021-06-09T15:32:06ZJakob KnollmuellerTest advi optim and parametric KLPhilipp Arrasparras@mpa-garching.mpg.dePhilipp Arrasparras@mpa-garching.mpg.dehttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/640Draft: More restrictive scaling operator2021-06-11T16:18:00ZPhilipp Arrasparras@mpa-garching.mpg.deDraft: More restrictive scaling operatorhttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/638Jax operator2021-07-01T10:23:36ZPhilipp Arrasparras@mpa-garching.mpg.deJax operatorMartin ReineckeMartin Reineckehttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/637Operator tests for more_samplers2021-06-08T09:32:23ZJakob KnollmuellerOperator tests for more_samplersPhilipp Arrasparras@mpa-garching.mpg.dePhilipp Arrasparras@mpa-garching.mpg.dehttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/634Fix floating point subdtype check in `kl_energies`2021-06-06T15:51:08ZLukas PlatzFix floating point subdtype check in `kl_energies``np.float` was [deprecated in Numpy 1.20](https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations).
The general class of floating point dtypes is `np.floating`, so check for that.`np.float` was [deprecated in Numpy 1.20](https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations).
The general class of floating point dtypes is `np.floating`, so check for that.https://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/633Fix docs2021-06-03T12:32:11ZPhilipp Arrasparras@mpa-garching.mpg.deFix docshttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/632Work on more samplers2021-06-03T11:24:23ZPhilipp FrankWork on more samplershttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/631Fix distances2021-06-06T12:56:14ZPhilipp Arrasparras@mpa-garching.mpg.deFix distanceshttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/630Draft: Fix floating point error domain inequality bug2021-06-06T11:32:59ZLukas PlatzDraft: Fix floating point error domain inequality bugAs it turns out, in Python `1. / i * i` is not exactly one for many integers, for example 49. In the range of 1-10000, this is true for 1178 ints. When creating an RGSpace `d` with the shape `(i,)`, `d == d.get_default_codomain().get_def...As it turns out, in Python `1. / i * i` is not exactly one for many integers, for example 49. In the range of 1-10000, this is true for 1178 ints. When creating an RGSpace `d` with the shape `(i,)`, `d == d.get_default_codomain().get_default_codomain()` is not necessarily true, because of potentially unequal `distances` values.
This is problematic since harmonic transform operators constructed with `domain=d.get_default_domain()` without giving an explicit target will for many values of `i` have a target unequal from `d`.
To alleviate this, this patch modiefies the `domain.__eq__()` function to compare `__hash__()` return values instead of manually comparing domain values and modiefies the `domain.__hash__()` function to round the `distances` entries to 15 decimals prior to hashing.
If using the hash in the comparison is unfavorable because of its performance impact, `__eq__()` could be restored to is previous state and the distance rounding be implemented in it, too.
@mtr: what do you think about this patch? Is there an obviously better solution?Martin ReineckeMartin Reineckehttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/629Work on geokl2021-05-31T13:45:52ZPhilipp FrankWork on geoklhttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/625Typo in docs2021-05-27T12:54:33ZPhilipp Arrasparras@mpa-garching.mpg.deTypo in docsMartin ReineckeMartin Reineckehttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/624Draft: Likelihoods2021-05-27T15:44:05ZPhilipp FrankDraft: Likelihoodshttps://gitlab.mpcdf.mpg.de/ift/nifty/-/merge_requests/623Update density_estimator priors.2021-05-25T09:33:49ZMatteo GuardianiUpdate density_estimator priors.Update density estimator priors.Update density estimator priors.Martin ReineckeMartin Reinecke