From a700932995d9cdec01e0aeb7e3eb39490068cbad Mon Sep 17 00:00:00 2001 From: FabricioArendTorres Date: Wed, 1 May 2024 20:42:16 +0200 Subject: [PATCH 1/2] renamed package to flowcon --- .gitignore | 2 +- README.md | 7 ++-- enflows/__init__.py | 1 - enflows/datasets/__init__.py | 2 - enflows/datasets/uci/__init__.py | 2 - enflows/distributions/__init__.py | 9 ---- enflows/flows/__init__.py | 3 -- enflows/nn/__init__.py | 2 - enflows/nn/nde/__init__.py | 1 - enflows/transforms/UMNN/__init__.py | 1 - enflows/transforms/lipschitz/__init__.py | 1 - enflows/transforms/matrix/__init__.py | 2 - enflows/transforms/splines/__init__.py | 10 ----- examples/conditional_toy_2d.py | 12 +++--- examples/toy_2d.py | 10 ++--- {enflows => flowcon}/CNF/__init__.py | 0 {enflows => flowcon}/CNF/cnf.py | 2 +- .../CNF/neural_odes/GITHUB_SOURCE | 0 {enflows => flowcon}/CNF/neural_odes/LICENSE | 0 .../CNF/neural_odes/__init__.py | 0 .../CNF/neural_odes/diffeq_layers/__init__.py | 0 .../CNF/neural_odes/diffeq_layers/basic.py | 0 .../neural_odes/diffeq_layers/container.py | 0 .../CNF/neural_odes/diffeq_layers/resnet.py | 0 .../CNF/neural_odes/diffeq_layers/wrappers.py | 0 .../CNF/neural_odes/odefunc.py | 2 +- .../CNF/neural_odes/squeeze.py | 0 {enflows => flowcon}/CNF/neural_odes/util.py | 0 .../CNF/neural_odes/wrappers/__init__.py | 0 .../wrappers/cnf_regularization.py | 0 flowcon/__init__.py | 1 + {enflows => flowcon}/datasets/LICENSE | 0 flowcon/datasets/__init__.py | 2 + {enflows => flowcon}/datasets/base.py | 0 {enflows => flowcon}/datasets/plane.py | 4 +- flowcon/datasets/uci/__init__.py | 2 + {enflows => flowcon}/datasets/uci/bsds300.py | 2 +- {enflows => flowcon}/datasets/uci/download.py | 2 +- {enflows => flowcon}/datasets/uci/gas.py | 2 +- {enflows => flowcon}/datasets/uci/hepmass.py | 2 +- .../datasets/uci/miniboone.py | 2 +- {enflows => flowcon}/datasets/uci/power.py | 2 +- {enflows => flowcon}/datasets/uci/uci.py | 10 ++--- {enflows => flowcon}/datasets/uci/utils.py | 0 flowcon/distributions/__init__.py | 9 ++++ {enflows => flowcon}/distributions/base.py | 4 +- .../distributions/discrete.py | 4 +- {enflows => flowcon}/distributions/mixture.py | 4 +- {enflows => flowcon}/distributions/normal.py | 4 +- {enflows => flowcon}/distributions/uniform.py | 0 flowcon/flows/__init__.py | 3 ++ {enflows => flowcon}/flows/autoregressive.py | 12 +++--- {enflows => flowcon}/flows/base.py | 4 +- {enflows => flowcon}/flows/realnvp.py | 12 +++--- flowcon/nn/__init__.py | 2 + flowcon/nn/nde/__init__.py | 1 + {enflows => flowcon}/nn/nde/made.py | 2 +- {enflows => flowcon}/nn/nets/__init__.py | 8 ++-- {enflows => flowcon}/nn/nets/activations.py | 2 +- .../nn/nets/extended_basic_nets.py | 0 .../nn/nets/invertible_densenet.py | 10 ++--- .../nn/nets/lipschitz_dense.py | 0 {enflows => flowcon}/nn/nets/mlp.py | 2 +- {enflows => flowcon}/nn/nets/nets_util.py | 0 {enflows => flowcon}/nn/nets/pila.cpp | 0 {enflows => flowcon}/nn/nets/pila.cu | 0 {enflows => flowcon}/nn/nets/pila.py | 0 {enflows => flowcon}/nn/nets/resnet.py | 2 +- {enflows => flowcon}/nn/nets/spectral_norm.py | 0 .../transforms/UMNN/MonotonicNormalizer.py | 2 +- flowcon/transforms/UMNN/__init__.py | 1 + {enflows => flowcon}/transforms/__init__.py | 42 +++++++++---------- .../transforms/adaptive_sigmoids.py | 6 +-- .../transforms/autoregressive/__init__.py | 4 +- .../autoregressive/autoregressive.py | 20 ++++----- .../transforms/autoregressive/deep_sigmoid.py | 22 +++++----- {enflows => flowcon}/transforms/base.py | 2 +- .../transforms/conditional.py | 18 ++++---- {enflows => flowcon}/transforms/conv.py | 6 +-- {enflows => flowcon}/transforms/coupling.py | 10 ++--- {enflows => flowcon}/transforms/linear.py | 6 +-- flowcon/transforms/lipschitz/__init__.py | 1 + .../transforms/lipschitz/iresblock.py | 10 ++--- .../transforms/lipschitz/util.py | 0 {enflows => flowcon}/transforms/lu.py | 2 +- {enflows => flowcon}/transforms/made.py | 2 +- flowcon/transforms/matrix/__init__.py | 2 + .../transforms/matrix/cholesky.py | 2 +- .../transforms/matrix/diagonal.py | 14 +++---- .../transforms/no_analytic_inv/__init__.py | 0 .../transforms/no_analytic_inv/base.py | 4 +- .../transforms/no_analytic_inv/planar.py | 8 ++-- .../transforms/nonlinearities.py | 6 +-- .../transforms/normalization.py | 4 +- {enflows => flowcon}/transforms/orthogonal.py | 6 +-- .../transforms/permutations.py | 4 +- {enflows => flowcon}/transforms/qr.py | 4 +- {enflows => flowcon}/transforms/reshape.py | 4 +- flowcon/transforms/splines/__init__.py | 10 +++++ .../transforms/splines/cubic.py | 4 +- .../transforms/splines/linear.py | 4 +- .../transforms/splines/quadratic.py | 4 +- .../transforms/splines/rational_quadratic.py | 4 +- {enflows => flowcon}/transforms/standard.py | 2 +- {enflows => flowcon}/transforms/svd.py | 4 +- {enflows => flowcon}/transforms/unitvector.py | 2 +- {enflows => flowcon}/utils/__init__.py | 4 +- {enflows => flowcon}/utils/torchutils.py | 2 +- {enflows => flowcon}/utils/typechecks.py | 0 {enflows => flowcon}/version.py | 0 setup.py | 4 +- tests/distributions/discrete_test.py | 2 +- tests/distributions/normal_test.py | 2 +- tests/flows/autoregressive_test.py | 2 +- tests/flows/base_test.py | 6 +-- tests/flows/realnvp_test.py | 2 +- tests/nets/lipschitz_test.py | 6 +-- tests/transforms/adaptive_sigmoid_test.py | 2 +- tests/transforms/autoregressive_test.py | 4 +- tests/transforms/base_test.py | 2 +- .../conditional/conditional_SVD_test.py | 4 +- .../conditional/conditional_lu_test.py | 6 +-- .../conditional_orthogonal_test.py | 4 +- .../conditional/conditional_planar.py | 4 +- .../conditional/conditional_scale_test.py | 4 +- tests/transforms/conv_test.py | 2 +- tests/transforms/coupling_test.py | 6 +-- tests/transforms/linear_test.py | 8 ++-- tests/transforms/lipschitz/TestiResBlock.py | 6 +-- tests/transforms/lu_test.py | 4 +- tests/transforms/made_test.py | 2 +- tests/transforms/matrix/cholesky.py | 4 +- tests/transforms/matrix/diagonal.py | 4 +- tests/transforms/nonlinearities_test.py | 8 ++-- tests/transforms/normalization_test.py | 4 +- tests/transforms/orthogonal_test.py | 4 +- tests/transforms/permutations_test.py | 2 +- tests/transforms/planar_test.py | 2 +- tests/transforms/qr_test.py | 4 +- tests/transforms/reshape_test.py | 2 +- tests/transforms/splines/cubic_test.py | 2 +- tests/transforms/splines/linear_test.py | 2 +- tests/transforms/splines/quadratic_test.py | 2 +- .../splines/rational_quadratic_test.py | 2 +- tests/transforms/standard_test.py | 2 +- tests/transforms/svd_test.py | 4 +- tests/transforms/transform_test.py | 4 +- tests/transforms/unitvector.py | 6 +-- tests/utils/torchutils_test.py | 2 +- 149 files changed, 289 insertions(+), 290 deletions(-) delete mode 100644 enflows/__init__.py delete mode 100644 enflows/datasets/__init__.py delete mode 100644 enflows/datasets/uci/__init__.py delete mode 100644 enflows/distributions/__init__.py delete mode 100644 enflows/flows/__init__.py delete mode 100644 enflows/nn/__init__.py delete mode 100644 enflows/nn/nde/__init__.py delete mode 100644 enflows/transforms/UMNN/__init__.py delete mode 100644 enflows/transforms/lipschitz/__init__.py delete mode 100644 enflows/transforms/matrix/__init__.py delete mode 100644 enflows/transforms/splines/__init__.py rename {enflows => flowcon}/CNF/__init__.py (100%) rename {enflows => flowcon}/CNF/cnf.py (99%) rename {enflows => flowcon}/CNF/neural_odes/GITHUB_SOURCE (100%) rename {enflows => flowcon}/CNF/neural_odes/LICENSE (100%) rename {enflows => flowcon}/CNF/neural_odes/__init__.py (100%) rename {enflows => flowcon}/CNF/neural_odes/diffeq_layers/__init__.py (100%) rename {enflows => flowcon}/CNF/neural_odes/diffeq_layers/basic.py (100%) rename {enflows => flowcon}/CNF/neural_odes/diffeq_layers/container.py (100%) rename {enflows => flowcon}/CNF/neural_odes/diffeq_layers/resnet.py (100%) rename {enflows => flowcon}/CNF/neural_odes/diffeq_layers/wrappers.py (100%) rename {enflows => flowcon}/CNF/neural_odes/odefunc.py (99%) rename {enflows => flowcon}/CNF/neural_odes/squeeze.py (100%) rename {enflows => flowcon}/CNF/neural_odes/util.py (100%) rename {enflows => flowcon}/CNF/neural_odes/wrappers/__init__.py (100%) rename {enflows => flowcon}/CNF/neural_odes/wrappers/cnf_regularization.py (100%) create mode 100644 flowcon/__init__.py rename {enflows => flowcon}/datasets/LICENSE (100%) create mode 100644 flowcon/datasets/__init__.py rename {enflows => flowcon}/datasets/base.py (100%) rename {enflows => flowcon}/datasets/plane.py (99%) create mode 100644 flowcon/datasets/uci/__init__.py rename {enflows => flowcon}/datasets/uci/bsds300.py (96%) rename {enflows => flowcon}/datasets/uci/download.py (96%) rename {enflows => flowcon}/datasets/uci/gas.py (98%) rename {enflows => flowcon}/datasets/uci/hepmass.py (98%) rename {enflows => flowcon}/datasets/uci/miniboone.py (98%) rename {enflows => flowcon}/datasets/uci/power.py (98%) rename {enflows => flowcon}/datasets/uci/uci.py (88%) rename {enflows => flowcon}/datasets/uci/utils.py (100%) create mode 100644 flowcon/distributions/__init__.py rename {enflows => flowcon}/distributions/base.py (99%) rename {enflows => flowcon}/distributions/discrete.py (96%) rename {enflows => flowcon}/distributions/mixture.py (92%) rename {enflows => flowcon}/distributions/normal.py (98%) rename {enflows => flowcon}/distributions/uniform.py (100%) create mode 100644 flowcon/flows/__init__.py rename {enflows => flowcon}/flows/autoregressive.py (84%) rename {enflows => flowcon}/flows/base.py (98%) rename {enflows => flowcon}/flows/realnvp.py (86%) create mode 100644 flowcon/nn/__init__.py create mode 100644 flowcon/nn/nde/__init__.py rename {enflows => flowcon}/nn/nde/made.py (99%) rename {enflows => flowcon}/nn/nets/__init__.py (62%) rename {enflows => flowcon}/nn/nets/activations.py (98%) rename {enflows => flowcon}/nn/nets/extended_basic_nets.py (100%) rename {enflows => flowcon}/nn/nets/invertible_densenet.py (98%) rename {enflows => flowcon}/nn/nets/lipschitz_dense.py (100%) rename {enflows => flowcon}/nn/nets/mlp.py (98%) rename {enflows => flowcon}/nn/nets/nets_util.py (100%) rename {enflows => flowcon}/nn/nets/pila.cpp (100%) rename {enflows => flowcon}/nn/nets/pila.cu (100%) rename {enflows => flowcon}/nn/nets/pila.py (100%) rename {enflows => flowcon}/nn/nets/resnet.py (99%) rename {enflows => flowcon}/nn/nets/spectral_norm.py (100%) rename {enflows => flowcon}/transforms/UMNN/MonotonicNormalizer.py (97%) create mode 100644 flowcon/transforms/UMNN/__init__.py rename {enflows => flowcon}/transforms/__init__.py (62%) rename {enflows => flowcon}/transforms/adaptive_sigmoids.py (97%) rename {enflows => flowcon}/transforms/autoregressive/__init__.py (86%) rename {enflows => flowcon}/transforms/autoregressive/autoregressive.py (97%) rename {enflows => flowcon}/transforms/autoregressive/deep_sigmoid.py (82%) rename {enflows => flowcon}/transforms/base.py (99%) rename {enflows => flowcon}/transforms/conditional.py (98%) rename {enflows => flowcon}/transforms/conv.py (91%) rename {enflows => flowcon}/transforms/coupling.py (99%) rename {enflows => flowcon}/transforms/linear.py (98%) create mode 100644 flowcon/transforms/lipschitz/__init__.py rename {enflows => flowcon}/transforms/lipschitz/iresblock.py (97%) rename {enflows => flowcon}/transforms/lipschitz/util.py (100%) rename {enflows => flowcon}/transforms/lu.py (98%) rename {enflows => flowcon}/transforms/made.py (99%) create mode 100644 flowcon/transforms/matrix/__init__.py rename {enflows => flowcon}/transforms/matrix/cholesky.py (97%) rename {enflows => flowcon}/transforms/matrix/diagonal.py (85%) rename {enflows => flowcon}/transforms/no_analytic_inv/__init__.py (100%) rename {enflows => flowcon}/transforms/no_analytic_inv/base.py (97%) rename {enflows => flowcon}/transforms/no_analytic_inv/planar.py (97%) rename {enflows => flowcon}/transforms/nonlinearities.py (99%) rename {enflows => flowcon}/transforms/normalization.py (98%) rename {enflows => flowcon}/transforms/orthogonal.py (98%) rename {enflows => flowcon}/transforms/permutations.py (97%) rename {enflows => flowcon}/transforms/qr.py (97%) rename {enflows => flowcon}/transforms/reshape.py (96%) create mode 100644 flowcon/transforms/splines/__init__.py rename {enflows => flowcon}/transforms/splines/cubic.py (98%) rename {enflows => flowcon}/transforms/splines/linear.py (97%) rename {enflows => flowcon}/transforms/splines/quadratic.py (98%) rename {enflows => flowcon}/transforms/splines/rational_quadratic.py (98%) rename {enflows => flowcon}/transforms/standard.py (98%) rename {enflows => flowcon}/transforms/svd.py (97%) rename {enflows => flowcon}/transforms/unitvector.py (96%) rename {enflows => flowcon}/utils/__init__.py (85%) rename {enflows => flowcon}/utils/torchutils.py (99%) rename {enflows => flowcon}/utils/typechecks.py (100%) rename {enflows => flowcon}/version.py (100%) diff --git a/.gitignore b/.gitignore index d8caf1c..d9c52fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # data location -enflows/datasets/uci/data/ +flowcon/datasets/uci/data/ # Development files and python cache diff --git a/README.md b/README.md index 9030cf7..2433f38 100644 --- a/README.md +++ b/README.md @@ -72,18 +72,17 @@ $ python examples/toy_2d.py As the core is based on `nflows`, its usage is similar. To define a flow: ```python -from enflows import transforms, distributions, flows +from flowcon import transforms, distributions, flows # Define an invertible transformation. transform = transforms.CompositeTransform([ - transforms.MaskedAffineAutoregressiveTransform(features=2, hidden_features=4), - transforms.RandomPermutation(features=2) + transforms.MaskedAffineAutoregressiveTransform(features=2, hidden_features=4), + transforms.RandomPermutation(features=2) ]) # Define a base distribution. base_distribution = distributions.StandardNormal(shape=[2]) - # Combine into a flow. flow = flows.Flow(transform=transform, distribution=base_distribution) ``` diff --git a/enflows/__init__.py b/enflows/__init__.py deleted file mode 100644 index f07ecc2..0000000 --- a/enflows/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from enflows.version import VERSION as __version__ diff --git a/enflows/datasets/__init__.py b/enflows/datasets/__init__.py deleted file mode 100644 index 25747e3..0000000 --- a/enflows/datasets/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from enflows.datasets.uci import load_uci_dataset, get_uci_dataset_range, get_uci_dataset_max_abs_value -from enflows.datasets.base import load_plane_dataset, InfiniteLoader, Dataset \ No newline at end of file diff --git a/enflows/datasets/uci/__init__.py b/enflows/datasets/uci/__init__.py deleted file mode 100644 index c7f2832..0000000 --- a/enflows/datasets/uci/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from enflows.datasets.uci.download import download_and_preprocess_uci_data -from enflows.datasets.uci.uci import load_uci_dataset, get_uci_dataset_range, get_uci_dataset_max_abs_value diff --git a/enflows/distributions/__init__.py b/enflows/distributions/__init__.py deleted file mode 100644 index 9d2ed6f..0000000 --- a/enflows/distributions/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -from enflows.distributions.base import Distribution, NoMeanException -from enflows.distributions.discrete import ConditionalIndependentBernoulli -from enflows.distributions.mixture import MADEMoG -from enflows.distributions.normal import ( - ConditionalDiagonalNormal, - DiagonalNormal, - StandardNormal, -) -from enflows.distributions.uniform import LotkaVolterraOscillating, MG1Uniform diff --git a/enflows/flows/__init__.py b/enflows/flows/__init__.py deleted file mode 100644 index 72ce0e9..0000000 --- a/enflows/flows/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from enflows.flows.autoregressive import MaskedAutoregressiveFlow -from enflows.flows.base import Flow -from enflows.flows.realnvp import SimpleRealNVP diff --git a/enflows/nn/__init__.py b/enflows/nn/__init__.py deleted file mode 100644 index 4580f13..0000000 --- a/enflows/nn/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from enflows.nn.nets import * - diff --git a/enflows/nn/nde/__init__.py b/enflows/nn/nde/__init__.py deleted file mode 100644 index a02e41e..0000000 --- a/enflows/nn/nde/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from enflows.nn.nde.made import MixtureOfGaussiansMADE diff --git a/enflows/transforms/UMNN/__init__.py b/enflows/transforms/UMNN/__init__.py deleted file mode 100644 index d23aaf1..0000000 --- a/enflows/transforms/UMNN/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from enflows.transforms.UMNN.MonotonicNormalizer import MonotonicNormalizer, IntegrandNet \ No newline at end of file diff --git a/enflows/transforms/lipschitz/__init__.py b/enflows/transforms/lipschitz/__init__.py deleted file mode 100644 index 1ecfb68..0000000 --- a/enflows/transforms/lipschitz/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from enflows.transforms.lipschitz.iresblock import iResBlock \ No newline at end of file diff --git a/enflows/transforms/matrix/__init__.py b/enflows/transforms/matrix/__init__.py deleted file mode 100644 index 7cdb466..0000000 --- a/enflows/transforms/matrix/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from enflows.transforms.matrix.diagonal import TransformDiagonal, TransformDiagonalSoftplus, TransformDiagonalExponential -from enflows.transforms.matrix.cholesky import CholeskyOuterProduct \ No newline at end of file diff --git a/enflows/transforms/splines/__init__.py b/enflows/transforms/splines/__init__.py deleted file mode 100644 index 5117f04..0000000 --- a/enflows/transforms/splines/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -from enflows.transforms.splines.cubic import cubic_spline, unconstrained_cubic_spline -from enflows.transforms.splines.linear import linear_spline, unconstrained_linear_spline -from enflows.transforms.splines.quadratic import ( - quadratic_spline, - unconstrained_quadratic_spline, -) -from enflows.transforms.splines.rational_quadratic import ( - rational_quadratic_spline, - unconstrained_rational_quadratic_spline, -) diff --git a/examples/conditional_toy_2d.py b/examples/conditional_toy_2d.py index c9c2123..a62c2f0 100644 --- a/examples/conditional_toy_2d.py +++ b/examples/conditional_toy_2d.py @@ -5,15 +5,15 @@ from torch import optim -from enflows.flows import Flow -from enflows.distributions.normal import DiagonalNormal -from enflows.transforms import (ActNorm, +from flowcon.flows import Flow +from flowcon.distributions.normal import DiagonalNormal +from flowcon.transforms import (ActNorm, iResBlock, CompositeTransform, ) -from enflows.nn.nets import * -from enflows.utils.torchutils import * -from enflows.datasets.base import load_plane_dataset, InfiniteLoader, PlaneDataset +from flowcon.nn.nets import * +from flowcon.utils.torchutils import * +from flowcon.datasets.base import load_plane_dataset, InfiniteLoader, PlaneDataset import logging logging.basicConfig( diff --git a/examples/toy_2d.py b/examples/toy_2d.py index dcaef5d..592a4a7 100644 --- a/examples/toy_2d.py +++ b/examples/toy_2d.py @@ -4,11 +4,11 @@ import torch from torch import optim -from enflows.flows import Flow -from enflows.distributions import StandardNormal -from enflows.datasets import load_plane_dataset, InfiniteLoader -from enflows.transforms import * -from enflows.nn.nets import * +from flowcon.flows import Flow +from flowcon.distributions import StandardNormal +from flowcon.datasets import load_plane_dataset, InfiniteLoader +from flowcon.transforms import * +from flowcon.nn.nets import * if torch.cuda.is_available(): device = "cuda" diff --git a/enflows/CNF/__init__.py b/flowcon/CNF/__init__.py similarity index 100% rename from enflows/CNF/__init__.py rename to flowcon/CNF/__init__.py diff --git a/enflows/CNF/cnf.py b/flowcon/CNF/cnf.py similarity index 99% rename from enflows/CNF/cnf.py rename to flowcon/CNF/cnf.py index b49c4ad..5f3837d 100644 --- a/enflows/CNF/cnf.py +++ b/flowcon/CNF/cnf.py @@ -2,7 +2,7 @@ import torch.nn as nn from torchdiffeq import odeint_adjoint as odeint -from enflows.CNF.neural_odes.wrappers.cnf_regularization import RegularizedODEfunc +from flowcon.CNF.neural_odes.wrappers.cnf_regularization import RegularizedODEfunc __all__ = ["CNF"] diff --git a/enflows/CNF/neural_odes/GITHUB_SOURCE b/flowcon/CNF/neural_odes/GITHUB_SOURCE similarity index 100% rename from enflows/CNF/neural_odes/GITHUB_SOURCE rename to flowcon/CNF/neural_odes/GITHUB_SOURCE diff --git a/enflows/CNF/neural_odes/LICENSE b/flowcon/CNF/neural_odes/LICENSE similarity index 100% rename from enflows/CNF/neural_odes/LICENSE rename to flowcon/CNF/neural_odes/LICENSE diff --git a/enflows/CNF/neural_odes/__init__.py b/flowcon/CNF/neural_odes/__init__.py similarity index 100% rename from enflows/CNF/neural_odes/__init__.py rename to flowcon/CNF/neural_odes/__init__.py diff --git a/enflows/CNF/neural_odes/diffeq_layers/__init__.py b/flowcon/CNF/neural_odes/diffeq_layers/__init__.py similarity index 100% rename from enflows/CNF/neural_odes/diffeq_layers/__init__.py rename to flowcon/CNF/neural_odes/diffeq_layers/__init__.py diff --git a/enflows/CNF/neural_odes/diffeq_layers/basic.py b/flowcon/CNF/neural_odes/diffeq_layers/basic.py similarity index 100% rename from enflows/CNF/neural_odes/diffeq_layers/basic.py rename to flowcon/CNF/neural_odes/diffeq_layers/basic.py diff --git a/enflows/CNF/neural_odes/diffeq_layers/container.py b/flowcon/CNF/neural_odes/diffeq_layers/container.py similarity index 100% rename from enflows/CNF/neural_odes/diffeq_layers/container.py rename to flowcon/CNF/neural_odes/diffeq_layers/container.py diff --git a/enflows/CNF/neural_odes/diffeq_layers/resnet.py b/flowcon/CNF/neural_odes/diffeq_layers/resnet.py similarity index 100% rename from enflows/CNF/neural_odes/diffeq_layers/resnet.py rename to flowcon/CNF/neural_odes/diffeq_layers/resnet.py diff --git a/enflows/CNF/neural_odes/diffeq_layers/wrappers.py b/flowcon/CNF/neural_odes/diffeq_layers/wrappers.py similarity index 100% rename from enflows/CNF/neural_odes/diffeq_layers/wrappers.py rename to flowcon/CNF/neural_odes/diffeq_layers/wrappers.py diff --git a/enflows/CNF/neural_odes/odefunc.py b/flowcon/CNF/neural_odes/odefunc.py similarity index 99% rename from enflows/CNF/neural_odes/odefunc.py rename to flowcon/CNF/neural_odes/odefunc.py index b2d25e1..4f2ba9b 100644 --- a/enflows/CNF/neural_odes/odefunc.py +++ b/flowcon/CNF/neural_odes/odefunc.py @@ -2,7 +2,7 @@ import numpy as np import torch import torch.nn as nn -from enflows.transforms import ActNorm +from flowcon.transforms import ActNorm from . import diffeq_layers from .squeeze import squeeze, unsqueeze diff --git a/enflows/CNF/neural_odes/squeeze.py b/flowcon/CNF/neural_odes/squeeze.py similarity index 100% rename from enflows/CNF/neural_odes/squeeze.py rename to flowcon/CNF/neural_odes/squeeze.py diff --git a/enflows/CNF/neural_odes/util.py b/flowcon/CNF/neural_odes/util.py similarity index 100% rename from enflows/CNF/neural_odes/util.py rename to flowcon/CNF/neural_odes/util.py diff --git a/enflows/CNF/neural_odes/wrappers/__init__.py b/flowcon/CNF/neural_odes/wrappers/__init__.py similarity index 100% rename from enflows/CNF/neural_odes/wrappers/__init__.py rename to flowcon/CNF/neural_odes/wrappers/__init__.py diff --git a/enflows/CNF/neural_odes/wrappers/cnf_regularization.py b/flowcon/CNF/neural_odes/wrappers/cnf_regularization.py similarity index 100% rename from enflows/CNF/neural_odes/wrappers/cnf_regularization.py rename to flowcon/CNF/neural_odes/wrappers/cnf_regularization.py diff --git a/flowcon/__init__.py b/flowcon/__init__.py new file mode 100644 index 0000000..6ba8cac --- /dev/null +++ b/flowcon/__init__.py @@ -0,0 +1 @@ +from flowcon.version import VERSION as __version__ diff --git a/enflows/datasets/LICENSE b/flowcon/datasets/LICENSE similarity index 100% rename from enflows/datasets/LICENSE rename to flowcon/datasets/LICENSE diff --git a/flowcon/datasets/__init__.py b/flowcon/datasets/__init__.py new file mode 100644 index 0000000..3622f31 --- /dev/null +++ b/flowcon/datasets/__init__.py @@ -0,0 +1,2 @@ +from flowcon.datasets.uci import load_uci_dataset, get_uci_dataset_range, get_uci_dataset_max_abs_value +from flowcon.datasets.base import load_plane_dataset, InfiniteLoader, Dataset \ No newline at end of file diff --git a/enflows/datasets/base.py b/flowcon/datasets/base.py similarity index 100% rename from enflows/datasets/base.py rename to flowcon/datasets/base.py diff --git a/enflows/datasets/plane.py b/flowcon/datasets/plane.py similarity index 99% rename from enflows/datasets/plane.py rename to flowcon/datasets/plane.py index 60f5b6f..a54ce2d 100644 --- a/enflows/datasets/plane.py +++ b/flowcon/datasets/plane.py @@ -8,7 +8,7 @@ from torch.utils.data import Dataset import sklearn.datasets -import enflows.utils as utils +import flowcon.utils as utils from sklearn.utils import shuffle as util_shuffle @@ -336,7 +336,7 @@ def _test(): torch.set_default_tensor_type('torch.cuda.FloatTensor') dataset = DiamondDataset(num_points=int(1e6), width=20, bound=2.5, std=0.04) - from enflows.utils import torchutils + from flowcon.utils import torchutils from matplotlib import pyplot as plt data = torchutils.tensor_to_np(dataset.data) fig, ax = plt.subplots(1, 1, figsize=(5, 5)) diff --git a/flowcon/datasets/uci/__init__.py b/flowcon/datasets/uci/__init__.py new file mode 100644 index 0000000..9ec7471 --- /dev/null +++ b/flowcon/datasets/uci/__init__.py @@ -0,0 +1,2 @@ +from flowcon.datasets.uci.download import download_and_preprocess_uci_data +from flowcon.datasets.uci.uci import load_uci_dataset, get_uci_dataset_range, get_uci_dataset_max_abs_value diff --git a/enflows/datasets/uci/bsds300.py b/flowcon/datasets/uci/bsds300.py similarity index 96% rename from enflows/datasets/uci/bsds300.py rename to flowcon/datasets/uci/bsds300.py index f606ea4..cf62252 100644 --- a/enflows/datasets/uci/bsds300.py +++ b/flowcon/datasets/uci/bsds300.py @@ -1,6 +1,6 @@ import numpy as np import os -import enflows.datasets.uci.utils as utils +import flowcon.datasets.uci.utils as utils from matplotlib import pyplot as plt from torch.utils import data diff --git a/enflows/datasets/uci/download.py b/flowcon/datasets/uci/download.py similarity index 96% rename from enflows/datasets/uci/download.py rename to flowcon/datasets/uci/download.py index f9a592b..0e98712 100644 --- a/enflows/datasets/uci/download.py +++ b/flowcon/datasets/uci/download.py @@ -20,7 +20,7 @@ def preprocess_uci_data() -> None: - from enflows.datasets.uci import gas, power, miniboone, hepmass + from flowcon.datasets.uci import gas, power, miniboone, hepmass gas.save_splits() power.save_splits() diff --git a/enflows/datasets/uci/gas.py b/flowcon/datasets/uci/gas.py similarity index 98% rename from enflows/datasets/uci/gas.py rename to flowcon/datasets/uci/gas.py index dfb2ba1..f2eb144 100644 --- a/enflows/datasets/uci/gas.py +++ b/flowcon/datasets/uci/gas.py @@ -3,7 +3,7 @@ from matplotlib import pyplot as plt from torch.utils.data import Dataset -import enflows.datasets.uci.utils as utils +import flowcon.datasets.uci.utils as utils def load_gas(): import pandas as pd diff --git a/enflows/datasets/uci/hepmass.py b/flowcon/datasets/uci/hepmass.py similarity index 98% rename from enflows/datasets/uci/hepmass.py rename to flowcon/datasets/uci/hepmass.py index a7f296b..fd449c1 100644 --- a/enflows/datasets/uci/hepmass.py +++ b/flowcon/datasets/uci/hepmass.py @@ -1,6 +1,6 @@ import numpy as np import os -import enflows.datasets.uci.utils as utils +import flowcon.datasets.uci.utils as utils from collections import Counter from matplotlib import pyplot as plt diff --git a/enflows/datasets/uci/miniboone.py b/flowcon/datasets/uci/miniboone.py similarity index 98% rename from enflows/datasets/uci/miniboone.py rename to flowcon/datasets/uci/miniboone.py index f77182f..d600159 100644 --- a/enflows/datasets/uci/miniboone.py +++ b/flowcon/datasets/uci/miniboone.py @@ -1,6 +1,6 @@ import numpy as np import os -import enflows.datasets.uci.utils as utils +import flowcon.datasets.uci.utils as utils from matplotlib import pyplot as plt from torch.utils.data import Dataset diff --git a/enflows/datasets/uci/power.py b/flowcon/datasets/uci/power.py similarity index 98% rename from enflows/datasets/uci/power.py rename to flowcon/datasets/uci/power.py index b5fe242..196369f 100644 --- a/enflows/datasets/uci/power.py +++ b/flowcon/datasets/uci/power.py @@ -1,6 +1,6 @@ import numpy as np import os -import enflows.datasets.uci.utils as utils +import flowcon.datasets.uci.utils as utils from matplotlib import pyplot as plt diff --git a/enflows/datasets/uci/uci.py b/flowcon/datasets/uci/uci.py similarity index 88% rename from enflows/datasets/uci/uci.py rename to flowcon/datasets/uci/uci.py index 82028b1..33fadf9 100644 --- a/enflows/datasets/uci/uci.py +++ b/flowcon/datasets/uci/uci.py @@ -17,11 +17,11 @@ def load_uci_dataset(name, split, frac=None): ValueError: If any of the arguments has an invalid value. """ - from enflows.datasets.uci.gas import GasDataset - from enflows.datasets.uci.power import PowerDataset - from enflows.datasets.uci.hepmass import HEPMASSDataset - from enflows.datasets.uci.miniboone import MiniBooNEDataset - from enflows.datasets.uci.bsds300 import BSDS300Dataset + from flowcon.datasets.uci.gas import GasDataset + from flowcon.datasets.uci.power import PowerDataset + from flowcon.datasets.uci.hepmass import HEPMASSDataset + from flowcon.datasets.uci.miniboone import MiniBooNEDataset + from flowcon.datasets.uci.bsds300 import BSDS300Dataset if split not in ['train', 'val', 'test']: raise ValueError('Split must be one of \'train\', \'val\' or \'test\'.') diff --git a/enflows/datasets/uci/utils.py b/flowcon/datasets/uci/utils.py similarity index 100% rename from enflows/datasets/uci/utils.py rename to flowcon/datasets/uci/utils.py diff --git a/flowcon/distributions/__init__.py b/flowcon/distributions/__init__.py new file mode 100644 index 0000000..a6a91bf --- /dev/null +++ b/flowcon/distributions/__init__.py @@ -0,0 +1,9 @@ +from flowcon.distributions.base import Distribution, NoMeanException +from flowcon.distributions.discrete import ConditionalIndependentBernoulli +from flowcon.distributions.mixture import MADEMoG +from flowcon.distributions.normal import ( + ConditionalDiagonalNormal, + DiagonalNormal, + StandardNormal, +) +from flowcon.distributions.uniform import LotkaVolterraOscillating, MG1Uniform diff --git a/enflows/distributions/base.py b/flowcon/distributions/base.py similarity index 99% rename from enflows/distributions/base.py rename to flowcon/distributions/base.py index c6f43c6..022f34f 100644 --- a/enflows/distributions/base.py +++ b/flowcon/distributions/base.py @@ -3,8 +3,8 @@ import torch from torch import nn, optim -from enflows.utils import torchutils -import enflows.utils.typechecks as check +from flowcon.utils import torchutils +import flowcon.utils.typechecks as check class NoMeanException(Exception): diff --git a/enflows/distributions/discrete.py b/flowcon/distributions/discrete.py similarity index 96% rename from enflows/distributions/discrete.py rename to flowcon/distributions/discrete.py index bb9b52a..bbcc9bc 100644 --- a/enflows/distributions/discrete.py +++ b/flowcon/distributions/discrete.py @@ -3,8 +3,8 @@ import torch from torch.nn import functional as F -from enflows.distributions.base import Distribution -from enflows.utils import torchutils +from flowcon.distributions.base import Distribution +from flowcon.utils import torchutils class ConditionalIndependentBernoulli(Distribution): diff --git a/enflows/distributions/mixture.py b/flowcon/distributions/mixture.py similarity index 92% rename from enflows/distributions/mixture.py rename to flowcon/distributions/mixture.py index ecfb270..142a008 100644 --- a/enflows/distributions/mixture.py +++ b/flowcon/distributions/mixture.py @@ -1,7 +1,7 @@ from torch.nn import functional as F -from enflows.distributions.base import Distribution -from enflows.nn.nde import MixtureOfGaussiansMADE +from flowcon.distributions.base import Distribution +from flowcon.nn.nde import MixtureOfGaussiansMADE class MADEMoG(Distribution): diff --git a/enflows/distributions/normal.py b/flowcon/distributions/normal.py similarity index 98% rename from enflows/distributions/normal.py rename to flowcon/distributions/normal.py index b733c79..83d554b 100644 --- a/enflows/distributions/normal.py +++ b/flowcon/distributions/normal.py @@ -4,8 +4,8 @@ import torch from torch import nn -from enflows.distributions.base import Distribution -from enflows.utils import torchutils +from flowcon.distributions.base import Distribution +from flowcon.utils import torchutils class StandardNormal(Distribution): diff --git a/enflows/distributions/uniform.py b/flowcon/distributions/uniform.py similarity index 100% rename from enflows/distributions/uniform.py rename to flowcon/distributions/uniform.py diff --git a/flowcon/flows/__init__.py b/flowcon/flows/__init__.py new file mode 100644 index 0000000..eef46e4 --- /dev/null +++ b/flowcon/flows/__init__.py @@ -0,0 +1,3 @@ +from flowcon.flows.autoregressive import MaskedAutoregressiveFlow +from flowcon.flows.base import Flow +from flowcon.flows.realnvp import SimpleRealNVP diff --git a/enflows/flows/autoregressive.py b/flowcon/flows/autoregressive.py similarity index 84% rename from enflows/flows/autoregressive.py rename to flowcon/flows/autoregressive.py index 320c244..7f63a3c 100644 --- a/enflows/flows/autoregressive.py +++ b/flowcon/flows/autoregressive.py @@ -2,12 +2,12 @@ from torch.nn import functional as F -from enflows.distributions.normal import StandardNormal -from enflows.flows.base import Flow -from enflows.transforms.autoregressive import MaskedAffineAutoregressiveTransform -from enflows.transforms.base import CompositeTransform -from enflows.transforms.normalization import BatchNorm -from enflows.transforms.permutations import RandomPermutation, ReversePermutation +from flowcon.distributions.normal import StandardNormal +from flowcon.flows.base import Flow +from flowcon.transforms.autoregressive import MaskedAffineAutoregressiveTransform +from flowcon.transforms.base import CompositeTransform +from flowcon.transforms.normalization import BatchNorm +from flowcon.transforms.permutations import RandomPermutation, ReversePermutation class MaskedAutoregressiveFlow(Flow): diff --git a/enflows/flows/base.py b/flowcon/flows/base.py similarity index 98% rename from enflows/flows/base.py rename to flowcon/flows/base.py index 901c44c..890f433 100644 --- a/enflows/flows/base.py +++ b/flowcon/flows/base.py @@ -2,8 +2,8 @@ import torch.nn -from enflows.distributions.base import Distribution -from enflows.utils import torchutils +from flowcon.distributions.base import Distribution +from flowcon.utils import torchutils from inspect import signature diff --git a/enflows/flows/realnvp.py b/flowcon/flows/realnvp.py similarity index 86% rename from enflows/flows/realnvp.py rename to flowcon/flows/realnvp.py index 77051db..d0a0fe2 100644 --- a/enflows/flows/realnvp.py +++ b/flowcon/flows/realnvp.py @@ -3,15 +3,15 @@ import torch from torch.nn import functional as F -from enflows.distributions.normal import StandardNormal -from enflows.flows.base import Flow -from enflows.nn import nets as nets -from enflows.transforms.base import CompositeTransform -from enflows.transforms.coupling import ( +from flowcon.distributions.normal import StandardNormal +from flowcon.flows.base import Flow +from flowcon.nn import nets as nets +from flowcon.transforms.base import CompositeTransform +from flowcon.transforms.coupling import ( AdditiveCouplingTransform, AffineCouplingTransform, ) -from enflows.transforms.normalization import BatchNorm +from flowcon.transforms.normalization import BatchNorm class SimpleRealNVP(Flow): diff --git a/flowcon/nn/__init__.py b/flowcon/nn/__init__.py new file mode 100644 index 0000000..031a825 --- /dev/null +++ b/flowcon/nn/__init__.py @@ -0,0 +1,2 @@ +from flowcon.nn.nets import * + diff --git a/flowcon/nn/nde/__init__.py b/flowcon/nn/nde/__init__.py new file mode 100644 index 0000000..78c5582 --- /dev/null +++ b/flowcon/nn/nde/__init__.py @@ -0,0 +1 @@ +from flowcon.nn.nde.made import MixtureOfGaussiansMADE diff --git a/enflows/nn/nde/made.py b/flowcon/nn/nde/made.py similarity index 99% rename from enflows/nn/nde/made.py rename to flowcon/nn/nde/made.py index dca7692..2d6ac11 100644 --- a/enflows/nn/nde/made.py +++ b/flowcon/nn/nde/made.py @@ -8,7 +8,7 @@ from torch.nn import functional as F from torch.nn import init -from enflows.utils import torchutils +from flowcon.utils import torchutils def _get_input_degrees(in_features): diff --git a/enflows/nn/nets/__init__.py b/flowcon/nn/nets/__init__.py similarity index 62% rename from enflows/nn/nets/__init__.py rename to flowcon/nn/nets/__init__.py index b5725ef..78a534e 100644 --- a/enflows/nn/nets/__init__.py +++ b/flowcon/nn/nets/__init__.py @@ -1,8 +1,8 @@ -from enflows.nn.nets.mlp import MLP, FCBlock -from enflows.nn.nets.resnet import ConvResidualNet, ResidualNet -from enflows.nn.nets.activations import Swish, CLipSwish, LeakyLSwish, FullSort, LipschitzCube, MaxMin, Sin, CSin, \ +from flowcon.nn.nets.mlp import MLP, FCBlock +from flowcon.nn.nets.resnet import ConvResidualNet, ResidualNet +from flowcon.nn.nets.activations import Swish, CLipSwish, LeakyLSwish, FullSort, LipschitzCube, MaxMin, Sin, CSin, \ LipSwish -from enflows.nn.nets.invertible_densenet import (DenseNet, +from flowcon.nn.nets.invertible_densenet import (DenseNet, MixedConditionalDenseNet, InputConditionalDenseNet, LastLayerConditionalDenseNet, diff --git a/enflows/nn/nets/activations.py b/flowcon/nn/nets/activations.py similarity index 98% rename from enflows/nn/nets/activations.py rename to flowcon/nn/nets/activations.py index a839074..948b211 100644 --- a/enflows/nn/nets/activations.py +++ b/flowcon/nn/nets/activations.py @@ -160,7 +160,7 @@ def __init__(self, k=5, device=None): super(Pila, self).__init__() assert k > 0 - from enflows.nn.nets.pila import PilaFunction + from flowcon.nn.nets.pila import PilaFunction self.PilaFunction = PilaFunction self.k = k diff --git a/enflows/nn/nets/extended_basic_nets.py b/flowcon/nn/nets/extended_basic_nets.py similarity index 100% rename from enflows/nn/nets/extended_basic_nets.py rename to flowcon/nn/nets/extended_basic_nets.py diff --git a/enflows/nn/nets/invertible_densenet.py b/flowcon/nn/nets/invertible_densenet.py similarity index 98% rename from enflows/nn/nets/invertible_densenet.py rename to flowcon/nn/nets/invertible_densenet.py index 7aea276..177e4bb 100644 --- a/enflows/nn/nets/invertible_densenet.py +++ b/flowcon/nn/nets/invertible_densenet.py @@ -8,11 +8,11 @@ from abc import ABC, abstractmethod from pprint import pformat -from enflows.nn.nets import activations -from enflows.nn.nets.extended_basic_nets import ExtendedSequential, ExtendedLinear -from enflows.nn.nets.spectral_norm import scaled_spectral_norm -from enflows.nn.nets.lipschitz_dense import LipschitzDenseLayer -from enflows.nn.nets import MLP +from flowcon.nn.nets import activations +from flowcon.nn.nets.extended_basic_nets import ExtendedSequential, ExtendedLinear +from flowcon.nn.nets.spectral_norm import scaled_spectral_norm +from flowcon.nn.nets.lipschitz_dense import LipschitzDenseLayer +from flowcon.nn.nets import MLP ACTIVATION_FNS = { 'relu': torch.nn.ReLU, diff --git a/enflows/nn/nets/lipschitz_dense.py b/flowcon/nn/nets/lipschitz_dense.py similarity index 100% rename from enflows/nn/nets/lipschitz_dense.py rename to flowcon/nn/nets/lipschitz_dense.py diff --git a/enflows/nn/nets/mlp.py b/flowcon/nn/nets/mlp.py similarity index 98% rename from enflows/nn/nets/mlp.py rename to flowcon/nn/nets/mlp.py index f8bea5a..5d75548 100644 --- a/enflows/nn/nets/mlp.py +++ b/flowcon/nn/nets/mlp.py @@ -6,7 +6,7 @@ from torch.nn import functional as F from typing import Callable -from enflows.nn.nets.nets_util import Sine, init_weights_normal, init_weights_selu, init_weights_elu, \ +from flowcon.nn.nets.nets_util import Sine, init_weights_normal, init_weights_selu, init_weights_elu, \ init_weights_xavier, gen_sine_init, first_layer_sine_init diff --git a/enflows/nn/nets/nets_util.py b/flowcon/nn/nets/nets_util.py similarity index 100% rename from enflows/nn/nets/nets_util.py rename to flowcon/nn/nets/nets_util.py diff --git a/enflows/nn/nets/pila.cpp b/flowcon/nn/nets/pila.cpp similarity index 100% rename from enflows/nn/nets/pila.cpp rename to flowcon/nn/nets/pila.cpp diff --git a/enflows/nn/nets/pila.cu b/flowcon/nn/nets/pila.cu similarity index 100% rename from enflows/nn/nets/pila.cu rename to flowcon/nn/nets/pila.cu diff --git a/enflows/nn/nets/pila.py b/flowcon/nn/nets/pila.py similarity index 100% rename from enflows/nn/nets/pila.py rename to flowcon/nn/nets/pila.py diff --git a/enflows/nn/nets/resnet.py b/flowcon/nn/nets/resnet.py similarity index 99% rename from enflows/nn/nets/resnet.py rename to flowcon/nn/nets/resnet.py index d5baf7b..12cdf8b 100644 --- a/enflows/nn/nets/resnet.py +++ b/flowcon/nn/nets/resnet.py @@ -3,7 +3,7 @@ from torch.nn import functional as F from torch.nn import init -import enflows.utils as utils +import flowcon.utils as utils class ResidualBlock(nn.Module): diff --git a/enflows/nn/nets/spectral_norm.py b/flowcon/nn/nets/spectral_norm.py similarity index 100% rename from enflows/nn/nets/spectral_norm.py rename to flowcon/nn/nets/spectral_norm.py diff --git a/enflows/transforms/UMNN/MonotonicNormalizer.py b/flowcon/transforms/UMNN/MonotonicNormalizer.py similarity index 97% rename from enflows/transforms/UMNN/MonotonicNormalizer.py rename to flowcon/transforms/UMNN/MonotonicNormalizer.py index bb16589..2dd0c74 100644 --- a/enflows/transforms/UMNN/MonotonicNormalizer.py +++ b/flowcon/transforms/UMNN/MonotonicNormalizer.py @@ -1,7 +1,7 @@ import torch from UMNN import NeuralIntegral, ParallelNeuralIntegral import torch.nn as nn -from enflows.transforms.no_analytic_inv.base import MonotonicTransform +from flowcon.transforms.no_analytic_inv.base import MonotonicTransform def _flatten(sequence): diff --git a/flowcon/transforms/UMNN/__init__.py b/flowcon/transforms/UMNN/__init__.py new file mode 100644 index 0000000..8aa72c0 --- /dev/null +++ b/flowcon/transforms/UMNN/__init__.py @@ -0,0 +1 @@ +from flowcon.transforms.UMNN.MonotonicNormalizer import MonotonicNormalizer, IntegrandNet \ No newline at end of file diff --git a/enflows/transforms/__init__.py b/flowcon/transforms/__init__.py similarity index 62% rename from enflows/transforms/__init__.py rename to flowcon/transforms/__init__.py index 2fb735e..32f583e 100644 --- a/enflows/transforms/__init__.py +++ b/flowcon/transforms/__init__.py @@ -1,4 +1,4 @@ -from enflows.transforms.autoregressive import ( +from flowcon.transforms.autoregressive import ( MaskedAffineAutoregressiveTransform, MaskedPiecewiseCubicAutoregressiveTransform, MaskedPiecewiseLinearAutoregressiveTransform, @@ -8,12 +8,12 @@ MaskedSumOfSigmoidsTransform, MaskedShiftAutoregressiveTransform ) -from enflows.transforms.no_analytic_inv.planar import ( +from flowcon.transforms.no_analytic_inv.planar import ( PlanarTransform, RadialTransform, SylvesterTransform ) -from enflows.transforms.base import ( +from flowcon.transforms.base import ( CompositeTransform, InputOutsideDomain, InverseNotAvailable, @@ -21,8 +21,8 @@ MultiscaleCompositeTransform, Transform, ) -from enflows.transforms.conv import OneByOneConvolution -from enflows.transforms.coupling import ( +from flowcon.transforms.conv import OneByOneConvolution +from flowcon.transforms.coupling import ( AdditiveCouplingTransform, AffineCouplingTransform, PiecewiseCubicCouplingTransform, @@ -31,9 +31,9 @@ PiecewiseRationalQuadraticCouplingTransform, UMNNCouplingTransform, ) -from enflows.transforms.linear import NaiveLinear, ScalarScale, ScalarShift -from enflows.transforms.lu import LULinear -from enflows.transforms.nonlinearities import ( +from flowcon.transforms.linear import NaiveLinear, ScalarScale, ScalarShift +from flowcon.transforms.lu import LULinear +from flowcon.transforms.nonlinearities import ( CompositeCDFTransform, Exp, GatedLinearUnit, @@ -48,27 +48,27 @@ Tanh, Softplus ) -from enflows.transforms.normalization import ActNorm, BatchNorm -from enflows.transforms.orthogonal import HouseholderSequence, ParametrizedHouseHolder +from flowcon.transforms.normalization import ActNorm, BatchNorm +from flowcon.transforms.orthogonal import HouseholderSequence, ParametrizedHouseHolder -from enflows.transforms.permutations import ( +from flowcon.transforms.permutations import ( Permutation, RandomPermutation, ReversePermutation, FillTriangular ) -from enflows.transforms.qr import QRLinear -from enflows.transforms.reshape import SqueezeTransform -from enflows.transforms.standard import ( +from flowcon.transforms.qr import QRLinear +from flowcon.transforms.reshape import SqueezeTransform +from flowcon.transforms.standard import ( # AffineScalarTransform, AffineTransform, IdentityTransform, PointwiseAffineTransform, ) -from enflows.transforms.adaptive_sigmoids import (SumOfSigmoids, DeepSigmoid) -from enflows.transforms.adaptive_sigmoids import (SumOfSigmoids, DeepSigmoid) -from enflows.transforms.svd import SVDLinear -from enflows.transforms.conditional import ( +from flowcon.transforms.adaptive_sigmoids import (SumOfSigmoids, DeepSigmoid) +from flowcon.transforms.adaptive_sigmoids import (SumOfSigmoids, DeepSigmoid) +from flowcon.transforms.svd import SVDLinear +from flowcon.transforms.conditional import ( ConditionalTransform, ConditionalPlanarTransform, ConditionalSylvesterTransform, @@ -82,7 +82,7 @@ ConditionalShiftTransform, ConditionalScaleTransform, ) -from enflows.transforms.unitvector import UnitVector -from enflows.transforms.matrix import (TransformDiagonal, TransformDiagonalSoftplus, TransformDiagonalExponential, +from flowcon.transforms.unitvector import UnitVector +from flowcon.transforms.matrix import (TransformDiagonal, TransformDiagonalSoftplus, TransformDiagonalExponential, CholeskyOuterProduct) -from enflows.transforms.lipschitz import (iResBlock) +from flowcon.transforms.lipschitz import (iResBlock) diff --git a/enflows/transforms/adaptive_sigmoids.py b/flowcon/transforms/adaptive_sigmoids.py similarity index 97% rename from enflows/transforms/adaptive_sigmoids.py rename to flowcon/transforms/adaptive_sigmoids.py index dd6b2b1..f24d207 100644 --- a/enflows/transforms/adaptive_sigmoids.py +++ b/flowcon/transforms/adaptive_sigmoids.py @@ -5,9 +5,9 @@ import numpy as np from abc import abstractmethod -from enflows.transforms.no_analytic_inv.base import MonotonicTransform -from enflows.transforms.base import Transform -from enflows.transforms.nonlinearities import ExtendedSoftplus, Sigmoid, Softplus +from flowcon.transforms.no_analytic_inv.base import MonotonicTransform +from flowcon.transforms.base import Transform +from flowcon.transforms.nonlinearities import ExtendedSoftplus, Sigmoid, Softplus class SumOfSigmoids(MonotonicTransform): diff --git a/enflows/transforms/autoregressive/__init__.py b/flowcon/transforms/autoregressive/__init__.py similarity index 86% rename from enflows/transforms/autoregressive/__init__.py rename to flowcon/transforms/autoregressive/__init__.py index 125f583..9fecd04 100644 --- a/enflows/transforms/autoregressive/__init__.py +++ b/flowcon/transforms/autoregressive/__init__.py @@ -1,4 +1,4 @@ -from enflows.transforms.autoregressive.autoregressive import (MaskedShiftAutoregressiveTransform, +from flowcon.transforms.autoregressive.autoregressive import (MaskedShiftAutoregressiveTransform, MaskedSumOfSigmoidsTransform, MaskedAffineAutoregressiveTransform, MaskedUMNNAutoregressiveTransform, @@ -6,4 +6,4 @@ MaskedPiecewiseLinearAutoregressiveTransform, MaskedPiecewiseCubicAutoregressiveTransform, MaskedPiecewiseQuadraticAutoregressiveTransform) -from enflows.transforms.autoregressive.deep_sigmoid import MaskedDeepSigmoidTransform +from flowcon.transforms.autoregressive.deep_sigmoid import MaskedDeepSigmoidTransform diff --git a/enflows/transforms/autoregressive/autoregressive.py b/flowcon/transforms/autoregressive/autoregressive.py similarity index 97% rename from enflows/transforms/autoregressive/autoregressive.py rename to flowcon/transforms/autoregressive/autoregressive.py index 417f315..cca3f76 100644 --- a/enflows/transforms/autoregressive/autoregressive.py +++ b/flowcon/transforms/autoregressive/autoregressive.py @@ -4,22 +4,22 @@ import torch from torch.nn import functional as F -from enflows.transforms.base import Transform -from enflows.transforms import made as made_module -from enflows.transforms.splines.cubic import cubic_spline -from enflows.transforms.splines.linear import linear_spline -from enflows.transforms.splines.quadratic import ( +from flowcon.transforms.base import Transform +from flowcon.transforms import made as made_module +from flowcon.transforms.splines.cubic import cubic_spline +from flowcon.transforms.splines.linear import linear_spline +from flowcon.transforms.splines.quadratic import ( quadratic_spline, unconstrained_quadratic_spline, ) -from enflows.transforms.splines import rational_quadratic -from enflows.transforms.splines.rational_quadratic import ( +from flowcon.transforms.splines import rational_quadratic +from flowcon.transforms.splines.rational_quadratic import ( rational_quadratic_spline, unconstrained_rational_quadratic_spline, ) -from enflows.utils import torchutils -from enflows.transforms.UMNN import * -from enflows.transforms.adaptive_sigmoids import SumOfSigmoids +from flowcon.utils import torchutils +from flowcon.transforms.UMNN import * +from flowcon.transforms.adaptive_sigmoids import SumOfSigmoids class AutoregressiveTransform(Transform): diff --git a/enflows/transforms/autoregressive/deep_sigmoid.py b/flowcon/transforms/autoregressive/deep_sigmoid.py similarity index 82% rename from enflows/transforms/autoregressive/deep_sigmoid.py rename to flowcon/transforms/autoregressive/deep_sigmoid.py index eb976f5..9d343c5 100644 --- a/enflows/transforms/autoregressive/deep_sigmoid.py +++ b/flowcon/transforms/autoregressive/deep_sigmoid.py @@ -2,23 +2,23 @@ import torch from torch.nn import functional as F -from enflows.transforms.base import Transform -from enflows.transforms import made as made_module -from enflows.transforms.splines.cubic import cubic_spline -from enflows.transforms.splines.linear import linear_spline -from enflows.transforms.splines.quadratic import ( +from flowcon.transforms.base import Transform +from flowcon.transforms import made as made_module +from flowcon.transforms.splines.cubic import cubic_spline +from flowcon.transforms.splines.linear import linear_spline +from flowcon.transforms.splines.quadratic import ( quadratic_spline, unconstrained_quadratic_spline, ) -from enflows.transforms.splines import rational_quadratic -from enflows.transforms.splines.rational_quadratic import ( +from flowcon.transforms.splines import rational_quadratic +from flowcon.transforms.splines.rational_quadratic import ( rational_quadratic_spline, unconstrained_rational_quadratic_spline, ) -from enflows.utils import torchutils -from enflows.transforms.UMNN import * -from enflows.transforms.adaptive_sigmoids import DeepSigmoidModule -from enflows.transforms.autoregressive.autoregressive import AutoregressiveTransform +from flowcon.utils import torchutils +from flowcon.transforms.UMNN import * +from flowcon.transforms.adaptive_sigmoids import DeepSigmoidModule +from flowcon.transforms.autoregressive.autoregressive import AutoregressiveTransform class MaskedDeepSigmoidTransform(AutoregressiveTransform): diff --git a/enflows/transforms/base.py b/flowcon/transforms/base.py similarity index 99% rename from enflows/transforms/base.py rename to flowcon/transforms/base.py index a8017ea..bad06c9 100644 --- a/enflows/transforms/base.py +++ b/flowcon/transforms/base.py @@ -4,7 +4,7 @@ import torch from torch import nn -import enflows.utils.typechecks as check +import flowcon.utils.typechecks as check class InverseNotAvailable(Exception): diff --git a/enflows/transforms/conditional.py b/flowcon/transforms/conditional.py similarity index 98% rename from enflows/transforms/conditional.py rename to flowcon/transforms/conditional.py index a9abfdb..d20824e 100644 --- a/enflows/transforms/conditional.py +++ b/flowcon/transforms/conditional.py @@ -4,19 +4,19 @@ import torch from torch.nn import functional as F -from enflows.transforms.base import Transform -from enflows.transforms.splines.linear import linear_spline -from enflows.transforms.splines import rational_quadratic -from enflows.transforms.splines.rational_quadratic import ( +from flowcon.transforms.base import Transform +from flowcon.transforms.splines.linear import linear_spline +from flowcon.transforms.splines import rational_quadratic +from flowcon.transforms.splines.rational_quadratic import ( rational_quadratic_spline, unconstrained_rational_quadratic_spline, ) -from enflows.transforms.UMNN import * +from flowcon.transforms.UMNN import * -from enflows.nn.nets import ResidualNet, MLP -from enflows.utils import torchutils -from enflows.transforms.orthogonal import ParametrizedHouseHolder, _apply_batchwise_transforms_nodet -from enflows.transforms.adaptive_sigmoids import SumOfSigmoids +from flowcon.nn.nets import ResidualNet, MLP +from flowcon.utils import torchutils +from flowcon.transforms.orthogonal import ParametrizedHouseHolder, _apply_batchwise_transforms_nodet +from flowcon.transforms.adaptive_sigmoids import SumOfSigmoids from typing import * diff --git a/enflows/transforms/conv.py b/flowcon/transforms/conv.py similarity index 91% rename from enflows/transforms/conv.py rename to flowcon/transforms/conv.py index c2c5e23..94f5ec5 100644 --- a/enflows/transforms/conv.py +++ b/flowcon/transforms/conv.py @@ -1,6 +1,6 @@ -from enflows.transforms.lu import LULinear -from enflows.transforms.permutations import RandomPermutation -from enflows.utils import torchutils +from flowcon.transforms.lu import LULinear +from flowcon.transforms.permutations import RandomPermutation +from flowcon.utils import torchutils class OneByOneConvolution(LULinear): diff --git a/enflows/transforms/coupling.py b/flowcon/transforms/coupling.py similarity index 99% rename from enflows/transforms/coupling.py rename to flowcon/transforms/coupling.py index 55be1e5..ab9ff2a 100644 --- a/enflows/transforms/coupling.py +++ b/flowcon/transforms/coupling.py @@ -5,16 +5,16 @@ import torch from torch.nn.functional import softplus -from enflows.transforms import splines -from enflows.transforms.base import Transform -from enflows.transforms.nonlinearities import ( +from flowcon.transforms import splines +from flowcon.transforms.base import Transform +from flowcon.transforms.nonlinearities import ( PiecewiseCubicCDF, PiecewiseLinearCDF, PiecewiseQuadraticCDF, PiecewiseRationalQuadraticCDF, ) -from enflows.utils import torchutils -from enflows.transforms.UMNN import * +from flowcon.utils import torchutils +from flowcon.transforms.UMNN import * class CouplingTransform(Transform): diff --git a/enflows/transforms/linear.py b/flowcon/transforms/linear.py similarity index 98% rename from enflows/transforms/linear.py rename to flowcon/transforms/linear.py index 79e2fd5..f232da1 100644 --- a/enflows/transforms/linear.py +++ b/flowcon/transforms/linear.py @@ -6,9 +6,9 @@ from torch.nn import functional as F from torch.nn import init -from enflows.transforms.base import Transform -from enflows.utils import torchutils -import enflows.utils.typechecks as check +from flowcon.transforms.base import Transform +from flowcon.utils import torchutils +import flowcon.utils.typechecks as check class LinearCache: diff --git a/flowcon/transforms/lipschitz/__init__.py b/flowcon/transforms/lipschitz/__init__.py new file mode 100644 index 0000000..a06a9e6 --- /dev/null +++ b/flowcon/transforms/lipschitz/__init__.py @@ -0,0 +1 @@ +from flowcon.transforms.lipschitz.iresblock import iResBlock \ No newline at end of file diff --git a/enflows/transforms/lipschitz/iresblock.py b/flowcon/transforms/lipschitz/iresblock.py similarity index 97% rename from enflows/transforms/lipschitz/iresblock.py rename to flowcon/transforms/lipschitz/iresblock.py index 5e6d3d4..5bc57df 100644 --- a/enflows/transforms/lipschitz/iresblock.py +++ b/flowcon/transforms/lipschitz/iresblock.py @@ -27,11 +27,11 @@ SOFTWARE. """ -from enflows.transforms import Transform -from enflows.utils.torchutils import batch_jacobian, logabsdet -from enflows.transforms.lipschitz.util import BiasedParameterGenerator, UnbiasedParameterGenerator, ParameterGenerator -from enflows.nn.nets.invertible_densenet import * -from enflows.nn.nets.invertible_densenet import _DenseNet +from flowcon.transforms import Transform +from flowcon.utils.torchutils import batch_jacobian, logabsdet +from flowcon.transforms.lipschitz.util import BiasedParameterGenerator, UnbiasedParameterGenerator, ParameterGenerator +from flowcon.nn.nets.invertible_densenet import * +from flowcon.nn.nets.invertible_densenet import _DenseNet import logging from typing import * diff --git a/enflows/transforms/lipschitz/util.py b/flowcon/transforms/lipschitz/util.py similarity index 100% rename from enflows/transforms/lipschitz/util.py rename to flowcon/transforms/lipschitz/util.py diff --git a/enflows/transforms/lu.py b/flowcon/transforms/lu.py similarity index 98% rename from enflows/transforms/lu.py rename to flowcon/transforms/lu.py index e8570e1..46458d5 100644 --- a/enflows/transforms/lu.py +++ b/flowcon/transforms/lu.py @@ -4,7 +4,7 @@ from torch.nn import functional as F from torch.nn import init -from enflows.transforms.linear import Linear +from flowcon.transforms.linear import Linear class LULinear(Linear): diff --git a/enflows/transforms/made.py b/flowcon/transforms/made.py similarity index 99% rename from enflows/transforms/made.py rename to flowcon/transforms/made.py index 99d16d5..2abecb6 100644 --- a/enflows/transforms/made.py +++ b/flowcon/transforms/made.py @@ -6,7 +6,7 @@ from torch.nn import functional as F from torch.nn import init -from enflows.utils import torchutils +from flowcon.utils import torchutils def _get_input_degrees(in_features): diff --git a/flowcon/transforms/matrix/__init__.py b/flowcon/transforms/matrix/__init__.py new file mode 100644 index 0000000..899c550 --- /dev/null +++ b/flowcon/transforms/matrix/__init__.py @@ -0,0 +1,2 @@ +from flowcon.transforms.matrix.diagonal import TransformDiagonal, TransformDiagonalSoftplus, TransformDiagonalExponential +from flowcon.transforms.matrix.cholesky import CholeskyOuterProduct \ No newline at end of file diff --git a/enflows/transforms/matrix/cholesky.py b/flowcon/transforms/matrix/cholesky.py similarity index 97% rename from enflows/transforms/matrix/cholesky.py rename to flowcon/transforms/matrix/cholesky.py index 6980b42..c42d190 100644 --- a/enflows/transforms/matrix/cholesky.py +++ b/flowcon/transforms/matrix/cholesky.py @@ -1,7 +1,7 @@ import numpy as np import torch from torch import nn -from enflows.transforms import Transform, ConditionalTransform, Exp, Sigmoid, ScalarScale, CompositeTransform, \ +from flowcon.transforms import Transform, ConditionalTransform, Exp, Sigmoid, ScalarScale, CompositeTransform, \ ScalarShift, Softplus diff --git a/enflows/transforms/matrix/diagonal.py b/flowcon/transforms/matrix/diagonal.py similarity index 85% rename from enflows/transforms/matrix/diagonal.py rename to flowcon/transforms/matrix/diagonal.py index 73e2d4e..6b36e8b 100644 --- a/enflows/transforms/matrix/diagonal.py +++ b/flowcon/transforms/matrix/diagonal.py @@ -2,15 +2,15 @@ import torch from torch import nn from torch.nn import functional as F -from enflows.distributions import Distribution -from enflows.transforms.base import Transform -from enflows.transforms.conditional import ConditionalTransform -from enflows.transforms import Transform, ConditionalTransform, Exp, Sigmoid, ScalarScale, CompositeTransform, \ +from flowcon.distributions import Distribution +from flowcon.transforms.base import Transform +from flowcon.transforms.conditional import ConditionalTransform +from flowcon.transforms import Transform, ConditionalTransform, Exp, Sigmoid, ScalarScale, CompositeTransform, \ ScalarShift, Softplus -from enflows.transforms.adaptive_sigmoids import SumOfSigmoids -from enflows.transforms.nonlinearities import ExtendedSoftplus +from flowcon.transforms.adaptive_sigmoids import SumOfSigmoids +from flowcon.transforms.nonlinearities import ExtendedSoftplus from torch.nn import init -from enflows.utils import torchutils +from flowcon.utils import torchutils fancy_exp_transform = CompositeTransform([Sigmoid(), ScalarScale(scale=80., trainable=False), diff --git a/enflows/transforms/no_analytic_inv/__init__.py b/flowcon/transforms/no_analytic_inv/__init__.py similarity index 100% rename from enflows/transforms/no_analytic_inv/__init__.py rename to flowcon/transforms/no_analytic_inv/__init__.py diff --git a/enflows/transforms/no_analytic_inv/base.py b/flowcon/transforms/no_analytic_inv/base.py similarity index 97% rename from enflows/transforms/no_analytic_inv/base.py rename to flowcon/transforms/no_analytic_inv/base.py index ee4378f..c3f93c0 100644 --- a/enflows/transforms/no_analytic_inv/base.py +++ b/flowcon/transforms/no_analytic_inv/base.py @@ -1,9 +1,9 @@ from abc import ABC -from enflows.transforms.base import Transform +from flowcon.transforms.base import Transform import torch from typing import Callable -import enflows.utils.torchutils as torchutils +import flowcon.utils.torchutils as torchutils class MonotonicTransform(Transform, ABC): diff --git a/enflows/transforms/no_analytic_inv/planar.py b/flowcon/transforms/no_analytic_inv/planar.py similarity index 97% rename from enflows/transforms/no_analytic_inv/planar.py rename to flowcon/transforms/no_analytic_inv/planar.py index 1375281..1b3a773 100644 --- a/enflows/transforms/no_analytic_inv/planar.py +++ b/flowcon/transforms/no_analytic_inv/planar.py @@ -4,10 +4,10 @@ from torch.nn import functional as F from torch.nn import init -from enflows.transforms.base import Transform -from enflows.utils import torchutils -import enflows.utils.typechecks as check -from enflows.transforms.orthogonal import HouseholderSequence +from flowcon.transforms.base import Transform +from flowcon.utils import torchutils +import flowcon.utils.typechecks as check +from flowcon.transforms.orthogonal import HouseholderSequence class PlanarTransform(Transform): diff --git a/enflows/transforms/nonlinearities.py b/flowcon/transforms/nonlinearities.py similarity index 99% rename from enflows/transforms/nonlinearities.py rename to flowcon/transforms/nonlinearities.py index 719216d..70c4026 100644 --- a/enflows/transforms/nonlinearities.py +++ b/flowcon/transforms/nonlinearities.py @@ -5,14 +5,14 @@ from torch import nn from torch.nn import functional as F -from enflows.transforms import splines -from enflows.transforms.base import ( +from flowcon.transforms import splines +from flowcon.transforms.base import ( CompositeTransform, InputOutsideDomain, InverseTransform, Transform, ) -from enflows.utils import torchutils +from flowcon.utils import torchutils class Exp(Transform): diff --git a/enflows/transforms/normalization.py b/flowcon/transforms/normalization.py similarity index 98% rename from enflows/transforms/normalization.py rename to flowcon/transforms/normalization.py index 2dad1b6..ee14eef 100644 --- a/enflows/transforms/normalization.py +++ b/flowcon/transforms/normalization.py @@ -4,8 +4,8 @@ from torch import nn from torch.nn import functional as F -from enflows.transforms.base import InverseNotAvailable, Transform -import enflows.utils.typechecks as check +from flowcon.transforms.base import InverseNotAvailable, Transform +import flowcon.utils.typechecks as check # class BatchNorm(Transform): # """Transform that performs batch normalization. diff --git a/enflows/transforms/orthogonal.py b/flowcon/transforms/orthogonal.py similarity index 98% rename from enflows/transforms/orthogonal.py rename to flowcon/transforms/orthogonal.py index 914a9a0..e6948db 100644 --- a/enflows/transforms/orthogonal.py +++ b/flowcon/transforms/orthogonal.py @@ -3,9 +3,9 @@ import torch from torch import nn -from enflows.transforms.base import Transform -from enflows.utils import torchutils -import enflows.utils.typechecks as check +from flowcon.transforms.base import Transform +from flowcon.utils import torchutils +import flowcon.utils.typechecks as check class HouseholderSequence(Transform): diff --git a/enflows/transforms/permutations.py b/flowcon/transforms/permutations.py similarity index 97% rename from enflows/transforms/permutations.py rename to flowcon/transforms/permutations.py index 38aac44..d7d7cfc 100644 --- a/enflows/transforms/permutations.py +++ b/flowcon/transforms/permutations.py @@ -2,8 +2,8 @@ import torch -from enflows.transforms.base import Transform -import enflows.utils.typechecks as check +from flowcon.transforms.base import Transform +import flowcon.utils.typechecks as check import numpy as np diff --git a/enflows/transforms/qr.py b/flowcon/transforms/qr.py similarity index 97% rename from enflows/transforms/qr.py rename to flowcon/transforms/qr.py index 8dab844..f459884 100644 --- a/enflows/transforms/qr.py +++ b/flowcon/transforms/qr.py @@ -4,8 +4,8 @@ from torch.nn import functional as F from torch.nn import init -from enflows.transforms.linear import Linear -from enflows.transforms.orthogonal import HouseholderSequence +from flowcon.transforms.linear import Linear +from flowcon.transforms.orthogonal import HouseholderSequence class QRLinear(Linear): diff --git a/enflows/transforms/reshape.py b/flowcon/transforms/reshape.py similarity index 96% rename from enflows/transforms/reshape.py rename to flowcon/transforms/reshape.py index b215044..532f1c5 100644 --- a/enflows/transforms/reshape.py +++ b/flowcon/transforms/reshape.py @@ -1,7 +1,7 @@ import torch -from enflows.transforms.base import Transform -import enflows.utils.typechecks as check +from flowcon.transforms.base import Transform +import flowcon.utils.typechecks as check class SqueezeTransform(Transform): diff --git a/flowcon/transforms/splines/__init__.py b/flowcon/transforms/splines/__init__.py new file mode 100644 index 0000000..6eb2973 --- /dev/null +++ b/flowcon/transforms/splines/__init__.py @@ -0,0 +1,10 @@ +from flowcon.transforms.splines.cubic import cubic_spline, unconstrained_cubic_spline +from flowcon.transforms.splines.linear import linear_spline, unconstrained_linear_spline +from flowcon.transforms.splines.quadratic import ( + quadratic_spline, + unconstrained_quadratic_spline, +) +from flowcon.transforms.splines.rational_quadratic import ( + rational_quadratic_spline, + unconstrained_rational_quadratic_spline, +) diff --git a/enflows/transforms/splines/cubic.py b/flowcon/transforms/splines/cubic.py similarity index 98% rename from enflows/transforms/splines/cubic.py rename to flowcon/transforms/splines/cubic.py index 7388c1a..13572f2 100644 --- a/enflows/transforms/splines/cubic.py +++ b/flowcon/transforms/splines/cubic.py @@ -3,8 +3,8 @@ import torch from torch.nn import functional as F -from enflows.transforms.base import InputOutsideDomain -from enflows.utils import torchutils +from flowcon.transforms.base import InputOutsideDomain +from flowcon.utils import torchutils DEFAULT_MIN_BIN_WIDTH = 1e-3 DEFAULT_MIN_BIN_HEIGHT = 1e-3 diff --git a/enflows/transforms/splines/linear.py b/flowcon/transforms/splines/linear.py similarity index 97% rename from enflows/transforms/splines/linear.py rename to flowcon/transforms/splines/linear.py index 5d4f00b..8a3956b 100644 --- a/enflows/transforms/splines/linear.py +++ b/flowcon/transforms/splines/linear.py @@ -2,8 +2,8 @@ import torch from torch.nn import functional as F -from enflows.transforms.base import InputOutsideDomain -from enflows.utils import torchutils +from flowcon.transforms.base import InputOutsideDomain +from flowcon.utils import torchutils def unconstrained_linear_spline( diff --git a/enflows/transforms/splines/quadratic.py b/flowcon/transforms/splines/quadratic.py similarity index 98% rename from enflows/transforms/splines/quadratic.py rename to flowcon/transforms/splines/quadratic.py index 1e83eea..a2babcc 100644 --- a/enflows/transforms/splines/quadratic.py +++ b/flowcon/transforms/splines/quadratic.py @@ -1,8 +1,8 @@ import torch from torch.nn import functional as F -from enflows.transforms.base import InputOutsideDomain -from enflows.utils import torchutils +from flowcon.transforms.base import InputOutsideDomain +from flowcon.utils import torchutils DEFAULT_MIN_BIN_WIDTH = 1e-3 DEFAULT_MIN_BIN_HEIGHT = 1e-3 diff --git a/enflows/transforms/splines/rational_quadratic.py b/flowcon/transforms/splines/rational_quadratic.py similarity index 98% rename from enflows/transforms/splines/rational_quadratic.py rename to flowcon/transforms/splines/rational_quadratic.py index 75bf92f..03e3a4f 100644 --- a/enflows/transforms/splines/rational_quadratic.py +++ b/flowcon/transforms/splines/rational_quadratic.py @@ -2,8 +2,8 @@ import torch from torch.nn import functional as F -from enflows.transforms.base import InputOutsideDomain -from enflows.utils import torchutils +from flowcon.transforms.base import InputOutsideDomain +from flowcon.utils import torchutils DEFAULT_MIN_BIN_WIDTH = 1e-3 DEFAULT_MIN_BIN_HEIGHT = 1e-3 diff --git a/enflows/transforms/standard.py b/flowcon/transforms/standard.py similarity index 98% rename from enflows/transforms/standard.py rename to flowcon/transforms/standard.py index c5d9de4..97e4ea1 100644 --- a/enflows/transforms/standard.py +++ b/flowcon/transforms/standard.py @@ -6,7 +6,7 @@ import torch from torch import Tensor -from enflows.transforms.base import Transform +from flowcon.transforms.base import Transform class IdentityTransform(Transform): diff --git a/enflows/transforms/svd.py b/flowcon/transforms/svd.py similarity index 97% rename from enflows/transforms/svd.py rename to flowcon/transforms/svd.py index 1273f2a..f77e98f 100644 --- a/enflows/transforms/svd.py +++ b/flowcon/transforms/svd.py @@ -4,8 +4,8 @@ from torch.nn import functional as F from torch.nn import init -from enflows.transforms.linear import Linear -from enflows.transforms.orthogonal import HouseholderSequence +from flowcon.transforms.linear import Linear +from flowcon.transforms.orthogonal import HouseholderSequence class SVDLinear(Linear): diff --git a/enflows/transforms/unitvector.py b/flowcon/transforms/unitvector.py similarity index 96% rename from enflows/transforms/unitvector.py rename to flowcon/transforms/unitvector.py index 9ef1f2e..ed5acac 100644 --- a/enflows/transforms/unitvector.py +++ b/flowcon/transforms/unitvector.py @@ -1,5 +1,5 @@ import torch -from enflows.transforms.base import Transform, InputOutsideDomain +from flowcon.transforms.base import Transform, InputOutsideDomain class UnitVector(Transform): diff --git a/enflows/utils/__init__.py b/flowcon/utils/__init__.py similarity index 85% rename from enflows/utils/__init__.py rename to flowcon/utils/__init__.py index dfa60d6..78b5948 100644 --- a/enflows/utils/__init__.py +++ b/flowcon/utils/__init__.py @@ -1,4 +1,4 @@ -from enflows.utils.torchutils import ( +from flowcon.utils.torchutils import ( cbrt, create_alternating_binary_mask, create_mid_split_binary_mask, @@ -17,7 +17,7 @@ np_to_tensor, tile, ) -from enflows.utils.typechecks import ( +from flowcon.utils.typechecks import ( is_bool, is_int, is_nonnegative_int, diff --git a/enflows/utils/torchutils.py b/flowcon/utils/torchutils.py similarity index 99% rename from enflows/utils/torchutils.py rename to flowcon/utils/torchutils.py index 4592bcf..fc94bc3 100644 --- a/enflows/utils/torchutils.py +++ b/flowcon/utils/torchutils.py @@ -1,5 +1,5 @@ """Various PyTorch utility functions.""" -from enflows.utils import typechecks as check +from flowcon.utils import typechecks as check import numpy as np import torch from numpy.typing import ArrayLike diff --git a/enflows/utils/typechecks.py b/flowcon/utils/typechecks.py similarity index 100% rename from enflows/utils/typechecks.py rename to flowcon/utils/typechecks.py diff --git a/enflows/version.py b/flowcon/version.py similarity index 100% rename from enflows/version.py rename to flowcon/version.py diff --git a/setup.py b/setup.py index d1bc489..d5b1bef 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,13 @@ from os import path from setuptools import find_packages, setup -from enflows.version import VERSION +from flowcon.version import VERSION this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( - name="enflows", + name="flowcon", version=VERSION, description="Normalizing flows in PyTorch. An extension of nflows.", long_description=long_description, diff --git a/tests/distributions/discrete_test.py b/tests/distributions/discrete_test.py index 4c6c05b..3c0a850 100644 --- a/tests/distributions/discrete_test.py +++ b/tests/distributions/discrete_test.py @@ -5,7 +5,7 @@ import torch import torchtestcase -from enflows.distributions import discrete +from flowcon.distributions import discrete class ConditionalIndependentBernoulliTest(torchtestcase.TorchTestCase): diff --git a/tests/distributions/normal_test.py b/tests/distributions/normal_test.py index 650f1c8..9fc1c76 100644 --- a/tests/distributions/normal_test.py +++ b/tests/distributions/normal_test.py @@ -5,7 +5,7 @@ import torch import torchtestcase -from enflows.distributions import normal +from flowcon.distributions import normal class StandardNormalTest(torchtestcase.TorchTestCase): diff --git a/tests/flows/autoregressive_test.py b/tests/flows/autoregressive_test.py index f64118c..c07eded 100644 --- a/tests/flows/autoregressive_test.py +++ b/tests/flows/autoregressive_test.py @@ -5,7 +5,7 @@ import torch import torchtestcase -from enflows.flows import autoregressive as ar +from flowcon.flows import autoregressive as ar class MaskedAutoregressiveFlowTest(torchtestcase.TorchTestCase): diff --git a/tests/flows/base_test.py b/tests/flows/base_test.py index 800e6b1..dcf826f 100644 --- a/tests/flows/base_test.py +++ b/tests/flows/base_test.py @@ -5,9 +5,9 @@ import torch import torchtestcase -from enflows.distributions.normal import StandardNormal -from enflows.flows import base -from enflows.transforms.standard import AffineScalarTransform +from flowcon.distributions.normal import StandardNormal +from flowcon.flows import base +from flowcon.transforms.standard import AffineScalarTransform class FlowTest(torchtestcase.TorchTestCase): diff --git a/tests/flows/realnvp_test.py b/tests/flows/realnvp_test.py index 82cf642..35a0cb2 100644 --- a/tests/flows/realnvp_test.py +++ b/tests/flows/realnvp_test.py @@ -5,7 +5,7 @@ import torch import torchtestcase -from enflows.flows import realnvp +from flowcon.flows import realnvp class SimpleRealNVPTest(torchtestcase.TorchTestCase): diff --git a/tests/nets/lipschitz_test.py b/tests/nets/lipschitz_test.py index c88fd27..fc8e984 100644 --- a/tests/nets/lipschitz_test.py +++ b/tests/nets/lipschitz_test.py @@ -4,11 +4,11 @@ from parameterized import parameterized_class import numpy as np -from enflows.nn.nets import mlp, spectral_norm, activations, lipschitz_dense -from enflows.nn.nets.spectral_norm import scaled_spectral_norm +from flowcon.nn.nets import mlp, spectral_norm, activations, lipschitz_dense +from flowcon.nn.nets.spectral_norm import scaled_spectral_norm from torch.nn.utils.parametrize import is_parametrized from types import SimpleNamespace -from enflows.utils.torchutils import tensor_to_np, batch_jacobian, logabsdet +from flowcon.utils.torchutils import tensor_to_np, batch_jacobian, logabsdet def _spectral_norm(model): diff --git a/tests/transforms/adaptive_sigmoid_test.py b/tests/transforms/adaptive_sigmoid_test.py index 2a06f45..d3c83a2 100644 --- a/tests/transforms/adaptive_sigmoid_test.py +++ b/tests/transforms/adaptive_sigmoid_test.py @@ -4,7 +4,7 @@ import torch -from enflows.transforms.adaptive_sigmoids import SumOfSigmoids, DeepSigmoid +from flowcon.transforms.adaptive_sigmoids import SumOfSigmoids, DeepSigmoid from tests.transforms.transform_test import TransformTest from parameterized import parameterized_class diff --git a/tests/transforms/autoregressive_test.py b/tests/transforms/autoregressive_test.py index c89019d..0f9d09e 100644 --- a/tests/transforms/autoregressive_test.py +++ b/tests/transforms/autoregressive_test.py @@ -4,8 +4,8 @@ import torch -from enflows.transforms import autoregressive, InverseTransform -from enflows.utils import torchutils +from flowcon.transforms import autoregressive, InverseTransform +from flowcon.utils import torchutils from tests.transforms.transform_test import TransformTest from parameterized import parameterized_class diff --git a/tests/transforms/base_test.py b/tests/transforms/base_test.py index 6ff01a2..ccec59e 100644 --- a/tests/transforms/base_test.py +++ b/tests/transforms/base_test.py @@ -4,7 +4,7 @@ import numpy as np import torch -from enflows.transforms import base, standard, ConditionalTransform, InverseTransform +from flowcon.transforms import base, standard, ConditionalTransform, InverseTransform from tests.transforms.transform_test import TransformTest diff --git a/tests/transforms/conditional/conditional_SVD_test.py b/tests/transforms/conditional/conditional_SVD_test.py index c89137d..948b80e 100644 --- a/tests/transforms/conditional/conditional_SVD_test.py +++ b/tests/transforms/conditional/conditional_SVD_test.py @@ -2,8 +2,8 @@ import torch -from enflows.transforms.conditional import ConditionalSVDTransform -from enflows.utils import torchutils +from flowcon.transforms.conditional import ConditionalSVDTransform +from flowcon.utils import torchutils from tests.transforms.transform_test import ConditionalTransformTest from parameterized import parameterized_class diff --git a/tests/transforms/conditional/conditional_lu_test.py b/tests/transforms/conditional/conditional_lu_test.py index e903bfd..93bd159 100644 --- a/tests/transforms/conditional/conditional_lu_test.py +++ b/tests/transforms/conditional/conditional_lu_test.py @@ -3,9 +3,9 @@ import unittest import torch -from enflows.transforms import lu -from enflows.transforms.conditional import ConditionalLUTransform -from enflows.utils import torchutils +from flowcon.transforms import lu +from flowcon.transforms.conditional import ConditionalLUTransform +from flowcon.utils import torchutils from tests.transforms.transform_test import ConditionalTransformTest import pytest from parameterized import parameterized, parameterized_class diff --git a/tests/transforms/conditional/conditional_orthogonal_test.py b/tests/transforms/conditional/conditional_orthogonal_test.py index a20795b..31b9e18 100644 --- a/tests/transforms/conditional/conditional_orthogonal_test.py +++ b/tests/transforms/conditional/conditional_orthogonal_test.py @@ -2,8 +2,8 @@ import torch -from enflows.transforms.conditional import ConditionalOrthogonalTransform -from enflows.utils import torchutils +from flowcon.transforms.conditional import ConditionalOrthogonalTransform +from flowcon.utils import torchutils from tests.transforms.transform_test import ConditionalTransformTest from parameterized import parameterized_class diff --git a/tests/transforms/conditional/conditional_planar.py b/tests/transforms/conditional/conditional_planar.py index 4a912f6..dd73672 100644 --- a/tests/transforms/conditional/conditional_planar.py +++ b/tests/transforms/conditional/conditional_planar.py @@ -3,8 +3,8 @@ import nflows.transforms import torch -from enflows.transforms.conditional import ConditionalPlanarTransform -from enflows.utils import torchutils +from flowcon.transforms.conditional import ConditionalPlanarTransform +from flowcon.utils import torchutils # from tests.transforms.transform_test import ConditionalTransformTest from tests.transforms.transform_test import TransformTest diff --git a/tests/transforms/conditional/conditional_scale_test.py b/tests/transforms/conditional/conditional_scale_test.py index fe73195..f227bf8 100644 --- a/tests/transforms/conditional/conditional_scale_test.py +++ b/tests/transforms/conditional/conditional_scale_test.py @@ -3,8 +3,8 @@ import unittest import torch -from enflows.transforms.conditional import ConditionalScaleTransform -from enflows.utils import torchutils +from flowcon.transforms.conditional import ConditionalScaleTransform +from flowcon.utils import torchutils from tests.transforms.transform_test import ConditionalTransformTest import pytest from parameterized import parameterized, parameterized_class diff --git a/tests/transforms/conv_test.py b/tests/transforms/conv_test.py index a76f920..a537642 100644 --- a/tests/transforms/conv_test.py +++ b/tests/transforms/conv_test.py @@ -2,7 +2,7 @@ import torch -from enflows.transforms.conv import OneByOneConvolution +from flowcon.transforms.conv import OneByOneConvolution from tests.transforms.transform_test import TransformTest diff --git a/tests/transforms/coupling_test.py b/tests/transforms/coupling_test.py index 25e8a20..9294505 100644 --- a/tests/transforms/coupling_test.py +++ b/tests/transforms/coupling_test.py @@ -4,9 +4,9 @@ import torch -from enflows.nn import nets -from enflows.transforms import coupling -from enflows.utils import torchutils +from flowcon.nn import nets +from flowcon.transforms import coupling +from flowcon.utils import torchutils from tests.transforms.transform_test import TransformTest diff --git a/tests/transforms/linear_test.py b/tests/transforms/linear_test.py index f66461f..608f8de 100644 --- a/tests/transforms/linear_test.py +++ b/tests/transforms/linear_test.py @@ -5,12 +5,12 @@ import torch -from enflows.transforms import linear -from enflows.transforms.linear import Linear, ScalarScale, ScalarShift -from enflows.utils import torchutils +from flowcon.transforms import linear +from flowcon.transforms.linear import Linear, ScalarScale, ScalarShift +from flowcon.utils import torchutils from tests.transforms.transform_test import TransformTest -from enflows.utils import torchutils +from flowcon.utils import torchutils from parameterized import parameterized_class diff --git a/tests/transforms/lipschitz/TestiResBlock.py b/tests/transforms/lipschitz/TestiResBlock.py index bf8d02c..9090b49 100644 --- a/tests/transforms/lipschitz/TestiResBlock.py +++ b/tests/transforms/lipschitz/TestiResBlock.py @@ -2,9 +2,9 @@ import unittest from parameterized import parameterized_class -from enflows.nn.nets import activations -from enflows.nn.nets.invertible_densenet import DenseNet -from enflows.transforms.lipschitz.iresblock import iResBlock +from flowcon.nn.nets import activations +from flowcon.nn.nets.invertible_densenet import DenseNet +from flowcon.transforms.lipschitz.iresblock import iResBlock from tests.transforms.transform_test import TransformTest torch.set_default_dtype(torch.float32) diff --git a/tests/transforms/lu_test.py b/tests/transforms/lu_test.py index e5ec221..7fa460a 100644 --- a/tests/transforms/lu_test.py +++ b/tests/transforms/lu_test.py @@ -4,8 +4,8 @@ import torch -from enflows.transforms import lu -from enflows.utils import torchutils +from flowcon.transforms import lu +from flowcon.utils import torchutils from tests.transforms.transform_test import TransformTest diff --git a/tests/transforms/made_test.py b/tests/transforms/made_test.py index 5cea2c2..bce5eb9 100644 --- a/tests/transforms/made_test.py +++ b/tests/transforms/made_test.py @@ -5,7 +5,7 @@ import torch import torchtestcase -from enflows.transforms import made +from flowcon.transforms import made class ShapeTest(torchtestcase.TorchTestCase): diff --git a/tests/transforms/matrix/cholesky.py b/tests/transforms/matrix/cholesky.py index b3b40bf..f59bcaf 100644 --- a/tests/transforms/matrix/cholesky.py +++ b/tests/transforms/matrix/cholesky.py @@ -3,8 +3,8 @@ from tests.transforms.transform_test import TransformTest from parameterized import parameterized_class -from enflows.utils import torchutils -from enflows.transforms import CholeskyOuterProduct, FillTriangular, InverseTransform +from flowcon.utils import torchutils +from flowcon.transforms import CholeskyOuterProduct, FillTriangular, InverseTransform torch.set_default_dtype(torch.float64) diff --git a/tests/transforms/matrix/diagonal.py b/tests/transforms/matrix/diagonal.py index 08db541..272a5a7 100644 --- a/tests/transforms/matrix/diagonal.py +++ b/tests/transforms/matrix/diagonal.py @@ -2,11 +2,11 @@ import torch -from enflows.transforms import InverseTransform, TransformDiagonal, Exp, CompositeTransform, Sigmoid, ScalarScale, \ +from flowcon.transforms import InverseTransform, TransformDiagonal, Exp, CompositeTransform, Sigmoid, ScalarScale, \ ScalarShift, Softplus, TransformDiagonalSoftplus, TransformDiagonalExponential from tests.transforms.transform_test import TransformTest from parameterized import parameterized_class -from enflows.utils import torchutils +from flowcon.utils import torchutils fancy_exp_transform = CompositeTransform([Sigmoid(), ScalarShift(1e-4, trainable=False), diff --git a/tests/transforms/nonlinearities_test.py b/tests/transforms/nonlinearities_test.py index f311a42..8d07c6c 100644 --- a/tests/transforms/nonlinearities_test.py +++ b/tests/transforms/nonlinearities_test.py @@ -4,10 +4,10 @@ import torch -from enflows.transforms import nonlinearities as nl -from enflows.transforms import standard -from enflows.transforms.base import InputOutsideDomain -from enflows.utils import torchutils +from flowcon.transforms import nonlinearities as nl +from flowcon.transforms import standard +from flowcon.transforms.base import InputOutsideDomain +from flowcon.utils import torchutils from tests.transforms.transform_test import TransformTest diff --git a/tests/transforms/normalization_test.py b/tests/transforms/normalization_test.py index 39a5ea8..9a625bf 100644 --- a/tests/transforms/normalization_test.py +++ b/tests/transforms/normalization_test.py @@ -4,8 +4,8 @@ import torch -from enflows.transforms import base -from enflows.transforms import normalization as norm +from flowcon.transforms import base +from flowcon.transforms import normalization as norm from tests.transforms.transform_test import TransformTest diff --git a/tests/transforms/orthogonal_test.py b/tests/transforms/orthogonal_test.py index 9ee19aa..bc3c23a 100644 --- a/tests/transforms/orthogonal_test.py +++ b/tests/transforms/orthogonal_test.py @@ -4,8 +4,8 @@ import torch -from enflows.transforms import orthogonal -from enflows.utils import torchutils +from flowcon.transforms import orthogonal +from flowcon.utils import torchutils from tests.transforms.transform_test import TransformTest class BatchwiseParameterizedHouseholderTest(TransformTest): diff --git a/tests/transforms/permutations_test.py b/tests/transforms/permutations_test.py index 5f8d938..e50fb16 100644 --- a/tests/transforms/permutations_test.py +++ b/tests/transforms/permutations_test.py @@ -4,7 +4,7 @@ import torch -from enflows.transforms import permutations, FillTriangular, InverseTransform +from flowcon.transforms import permutations, FillTriangular, InverseTransform from tests.transforms.transform_test import TransformTest from parameterized import parameterized_class diff --git a/tests/transforms/planar_test.py b/tests/transforms/planar_test.py index 1baa1cb..7e1d6c3 100644 --- a/tests/transforms/planar_test.py +++ b/tests/transforms/planar_test.py @@ -4,7 +4,7 @@ import torch -from enflows.transforms import PlanarTransform +from flowcon.transforms import PlanarTransform from tests.transforms.transform_test import TransformTest import numpy as np import random diff --git a/tests/transforms/qr_test.py b/tests/transforms/qr_test.py index b6f5ea7..1f006dc 100644 --- a/tests/transforms/qr_test.py +++ b/tests/transforms/qr_test.py @@ -2,8 +2,8 @@ import torch -from enflows.transforms import qr -from enflows.utils import torchutils +from flowcon.transforms import qr +from flowcon.utils import torchutils from tests.transforms.transform_test import TransformTest diff --git a/tests/transforms/reshape_test.py b/tests/transforms/reshape_test.py index ef2fa75..fe82dff 100644 --- a/tests/transforms/reshape_test.py +++ b/tests/transforms/reshape_test.py @@ -2,7 +2,7 @@ import torch -from enflows.transforms.reshape import SqueezeTransform +from flowcon.transforms.reshape import SqueezeTransform from tests.transforms.transform_test import TransformTest diff --git a/tests/transforms/splines/cubic_test.py b/tests/transforms/splines/cubic_test.py index 0edd8a0..1fdbef0 100644 --- a/tests/transforms/splines/cubic_test.py +++ b/tests/transforms/splines/cubic_test.py @@ -1,7 +1,7 @@ import torch import torchtestcase -from enflows.transforms import splines +from flowcon.transforms import splines class CubicSplineTest(torchtestcase.TorchTestCase): diff --git a/tests/transforms/splines/linear_test.py b/tests/transforms/splines/linear_test.py index 07c34b5..3db0980 100644 --- a/tests/transforms/splines/linear_test.py +++ b/tests/transforms/splines/linear_test.py @@ -1,7 +1,7 @@ import torch import torchtestcase -from enflows.transforms import splines +from flowcon.transforms import splines class LinearSplineTest(torchtestcase.TorchTestCase): diff --git a/tests/transforms/splines/quadratic_test.py b/tests/transforms/splines/quadratic_test.py index 5e08e06..af9b5a1 100644 --- a/tests/transforms/splines/quadratic_test.py +++ b/tests/transforms/splines/quadratic_test.py @@ -1,7 +1,7 @@ import torch import torchtestcase -from enflows.transforms import splines +from flowcon.transforms import splines class QuadraticSplineTest(torchtestcase.TorchTestCase): diff --git a/tests/transforms/splines/rational_quadratic_test.py b/tests/transforms/splines/rational_quadratic_test.py index 767492b..24445a6 100644 --- a/tests/transforms/splines/rational_quadratic_test.py +++ b/tests/transforms/splines/rational_quadratic_test.py @@ -1,7 +1,7 @@ import torch import torchtestcase -from enflows.transforms import splines +from flowcon.transforms import splines class RationalQuadraticSplineTest(torchtestcase.TorchTestCase): diff --git a/tests/transforms/standard_test.py b/tests/transforms/standard_test.py index e9545f0..d176333 100644 --- a/tests/transforms/standard_test.py +++ b/tests/transforms/standard_test.py @@ -5,7 +5,7 @@ import numpy as np import torch -from enflows.transforms import standard +from flowcon.transforms import standard from tests.transforms.transform_test import TransformTest diff --git a/tests/transforms/svd_test.py b/tests/transforms/svd_test.py index 5aaeb39..0383a05 100644 --- a/tests/transforms/svd_test.py +++ b/tests/transforms/svd_test.py @@ -2,8 +2,8 @@ import torch -from enflows.transforms.svd import SVDLinear -from enflows.utils import torchutils +from flowcon.transforms.svd import SVDLinear +from flowcon.utils import torchutils from tests.transforms.transform_test import TransformTest diff --git a/tests/transforms/transform_test.py b/tests/transforms/transform_test.py index 13d714b..b56a4e3 100644 --- a/tests/transforms/transform_test.py +++ b/tests/transforms/transform_test.py @@ -1,8 +1,8 @@ import torch import torchtestcase -from enflows.transforms import base -from enflows.utils import torchutils +from flowcon.transforms import base +from flowcon.utils import torchutils class TransformTest(torchtestcase.TorchTestCase): diff --git a/tests/transforms/unitvector.py b/tests/transforms/unitvector.py index 6bbc007..e3b380e 100644 --- a/tests/transforms/unitvector.py +++ b/tests/transforms/unitvector.py @@ -4,10 +4,10 @@ import torch -from enflows.transforms import UnitVector, InverseTransform -from enflows.utils import torchutils +from flowcon.transforms import UnitVector, InverseTransform +from flowcon.utils import torchutils from tests.transforms.transform_test import TransformTest -from enflows.utils import torchutils +from flowcon.utils import torchutils from parameterized import parameterized_class diff --git a/tests/utils/torchutils_test.py b/tests/utils/torchutils_test.py index 39203c6..46d6c72 100644 --- a/tests/utils/torchutils_test.py +++ b/tests/utils/torchutils_test.py @@ -4,7 +4,7 @@ import torch -from enflows.utils import torchutils +from flowcon.utils import torchutils import torchtestcase import numpy as np From fcb98ba9111147e7ebdaac1dd0a993878aa3ff05 Mon Sep 17 00:00:00 2001 From: Fabricio Arend Torres <9096900+FabricioArendTorres@users.noreply.github.com> Date: Wed, 1 May 2024 20:53:36 +0200 Subject: [PATCH 2/2] changed name to flowcon --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 2bf3dc5..478d16e 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -44,7 +44,7 @@ jobs: # Specifying a GitHub environment is optional, but strongly encouraged environment: name: release - url: https://pypi.org/p/enflows + url: https://pypi.org/p/flowcon permissions: # IMPORTANT: this permission is mandatory for trusted publishing id-token: write