Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
a5d2c35
Implement scalable USFlows with BlockLUTransform
fariedabuzaid Mar 18, 2025
6f99b17
Implement InverseTransform
fariedabuzaid Mar 18, 2025
c732abb
(WIP) Implement scalable USflows
fariedabuzaid Mar 18, 2025
499d5f8
Adopt BlockLUTransform to channel-first format
fariedabuzaid Mar 18, 2025
cde90ea
(WIP) Add space-to-depth conversion to image datasets
fariedabuzaid Mar 18, 2025
847a4bb
Correct Typo
fariedabuzaid Mar 18, 2025
e632f82
(Untested) Implemnt USFlow
fariedabuzaid Mar 18, 2025
2ff6b0c
Bugfixes
fariedabuzaid Mar 20, 2025
fdad8a1
add usflow test config
fariedabuzaid Mar 20, 2025
1fc9cd0
shape of zeros
turnmanh Mar 20, 2025
f153625
Bugfixes
fariedabuzaid Mar 20, 2025
611af78
Adjust config
fariedabuzaid Mar 21, 2025
3baf7a0
using cuda
turnmanh Mar 21, 2025
70b7554
Implement householder transform + structural improvements
fariedabuzaid Mar 22, 2025
facef16
Add householder + efficiency improvements
fariedabuzaid Mar 22, 2025
1e86793
Update test config (cpu)
fariedabuzaid Mar 22, 2025
c74d268
Workaround: new Ray temp structure
fariedabuzaid Mar 24, 2025
40a381d
Readd log-prior
fariedabuzaid Mar 24, 2025
f3b95bb
moving data to the same device as input
turnmanh Mar 24, 2025
9655ab2
Merge branch 'fix-usflows' of github.com:aai-institute/USFlows into f…
turnmanh Mar 24, 2025
d9fd9b9
setting device in initialization
turnmanh Mar 24, 2025
ab9e7ca
added gpu config
turnmanh Mar 24, 2025
f9f07c6
Affine layer simplification + Onnx export + fix bug in constructor
fariedabuzaid Mar 24, 2025
2a23611
moved weights and bias to the same device as y
turnmanh Mar 25, 2025
ded89ca
bugfix
fariedabuzaid Mar 26, 2025
7373572
Merge branch 'fix-usflows' of https://github.com/aai-institute/USFlow…
fariedabuzaid Mar 26, 2025
d54549f
docstring
turnmanh Mar 27, 2025
82f5d6f
fixed number of channels in gating
turnmanh Mar 27, 2025
ef8f5bd
init commit
turnmanh Mar 27, 2025
f04242a
typing already in func. signature
turnmanh Mar 27, 2025
bd70234
cond. conv. conditioner network
turnmanh Mar 28, 2025
d7711b0
update
turnmanh Mar 28, 2025
5d8d82d
type hinting
turnmanh Mar 28, 2025
886542b
move noise to device
turnmanh Mar 28, 2025
25b4d18
assert on barch size
turnmanh Apr 1, 2025
d32e5eb
alternate coupling
fariedabuzaid Apr 3, 2025
cbbe835
Uniform ScaleTranform prior
fariedabuzaid Apr 3, 2025
8eb5cfc
Adopt Radial Distribution to higher rank tensors
fariedabuzaid Apr 3, 2025
85c0024
Implement trainable distribution parameters
fariedabuzaid Apr 4, 2025
008e6ec
minor improvements / bugfixes
fariedabuzaid Apr 4, 2025
69b46ec
Make distribution parameters known to optimizer
fariedabuzaid Apr 5, 2025
329e744
Implement Mixture trainable Distributions
fariedabuzaid Apr 5, 2025
33e18c4
Merge pull request #66 from aai-institute/feat/improved-conv-conditioner
fariedabuzaid Apr 7, 2025
4facfd1
Add simple BottleneckNetwork
fariedabuzaid Apr 7, 2025
5b3207b
Merge branch 'fix-usflows' of https://github.com/aai-institute/USFlow…
fariedabuzaid Apr 7, 2025
07e23d5
Add hyperopt config
fariedabuzaid Apr 7, 2025
1806cac
update config
fariedabuzaid Apr 7, 2025
2c48ffa
list to ModuleList
turnmanh Apr 7, 2025
246d80d
draft impl. of radial mixture model
turnmanh Apr 8, 2025
4e016ad
Bugfixes RadialMM
fariedabuzaid Apr 8, 2025
ccc29cf
config incl. radial mm
turnmanh Apr 8, 2025
6a6b1b0
wip
turnmanh Apr 8, 2025
8330085
Bugfixes
fariedabuzaid Apr 8, 2025
8aca9fe
Bugfixes
fariedabuzaid Apr 8, 2025
6ccbf23
minor change
fariedabuzaid Apr 9, 2025
a1b98da
mitigating duplication
turnmanh Apr 9, 2025
20b2383
mixture weights of radial distribution are trainable
turnmanh Apr 10, 2025
0d9b2a0
Normalizing of layers made optional
turnmanh Apr 10, 2025
daecbfb
Merge pull request #71 from aai-institute/feat/radial-mixture
fariedabuzaid Apr 10, 2025
0f9c456
forarding LayerNorm flag
turnmanh Apr 10, 2025
b384694
Merge pull request #72 from aai-institute/fix/normalization-in-cond-cnn
fariedabuzaid Apr 10, 2025
fca5c4e
moving mixture weights to device
turnmanh Apr 10, 2025
b7abf8f
cleaning up comments
turnmanh Apr 10, 2025
e964ac3
Minimal config for verification
fariedabuzaid Apr 10, 2025
161273d
Bugfix: Fix handling of context
fariedabuzaid Apr 10, 2025
395367a
minimal config for verification
fariedabuzaid Apr 10, 2025
c16feaa
adopt config
fariedabuzaid Apr 10, 2025
32ef85e
Merge pull request #73 from aai-institute/fix/device-for-base-distrib…
fariedabuzaid Apr 10, 2025
2096a8f
feature: Make gating in CondConv2D optional
fariedabuzaid Apr 11, 2025
66bb8f6
cleanup: remove debugging output
fariedabuzaid Apr 13, 2025
0d99bd9
Feature: Set flow device at init
fariedabuzaid Apr 13, 2025
04194c1
Update: remove complex layers from minimal config
fariedabuzaid Apr 13, 2025
725ddb8
Feature: USFlow, configurable masking
fariedabuzaid Apr 14, 2025
162d023
Update minimal config: Custom base distribution
fariedabuzaid Apr 14, 2025
567d3a6
add mixture norm distribution experiment
fariedabuzaid Apr 16, 2025
2b6712c
add Parameter constraint for Gamma distribution
fariedabuzaid Apr 16, 2025
f94696a
initialize dataset in _trial function
fariedabuzaid Apr 16, 2025
bf5dcd0
Update config
fariedabuzaid Apr 16, 2025
1edc3f3
Refactor DistributionModules
fariedabuzaid Apr 28, 2025
5db187e
Refactor Categorical
fariedabuzaid Apr 28, 2025
bbdd1b9
Refactor distribution modules (final)
fariedabuzaid Apr 28, 2025
190a278
Update config
fariedabuzaid Apr 28, 2025
afd0ac4
Revision distribution refactoring (because of ray deepcopy error)
fariedabuzaid Apr 28, 2025
e316c9a
Update config
fariedabuzaid Apr 28, 2025
0b39626
Bugfix Ray Hyperopt: Avoid "deepcopy messing computation graph"
fariedabuzaid Apr 28, 2025
4ba34a8
Bugfix config
fariedabuzaid Apr 28, 2025
3171860
Bugfix: adpot test set loading in test_best_model
fariedabuzaid Apr 29, 2025
486080c
device mgmt. in test
turnmanh Apr 29, 2025
54184e8
update config
fariedabuzaid Apr 29, 2025
d1bb7ef
(WIP) Add Sophia Optimizer
fariedabuzaid Apr 29, 2025
a34d1f8
Simplify BlockAffineTransform to ordinary Conv Layer via self.simplify()
fariedabuzaid Jun 27, 2025
a02ff35
WIP Implement UDL calibration / refactoring
fariedabuzaid Jul 14, 2025
aa14b3c
Bugfix: intersect intervals
fariedabuzaid Jul 15, 2025
3c00718
Cleanup
fariedabuzaid Jul 15, 2025
e482690
Cleanup
fariedabuzaid Jul 15, 2025
7646737
bugfix
fariedabuzaid Jul 15, 2025
2b4be2d
Cleanup
fariedabuzaid Jul 15, 2025
7f41eae
Bugfix: leanable distributions + minor cleanups
fariedabuzaid Jul 21, 2025
1c5040e
Add Evaluation Class
fariedabuzaid Jul 25, 2025
2b08261
Add additional (mixture norm distributions)
fariedabuzaid Jul 29, 2025
69053aa
add l1 symmetry tests
fariedabuzaid Jul 30, 2025
00b44c1
update
fariedabuzaid Jul 31, 2025
5b28e33
full mnist
fariedabuzaid Jul 31, 2025
f3f7868
Update optimizer
fariedabuzaid Jul 31, 2025
b258af1
Update Optimizer
fariedabuzaid Jul 31, 2025
cbf15f8
bugfix
fariedabuzaid Jul 31, 2025
b6628aa
Update Experiemnts
fariedabuzaid Aug 1, 2025
7d6d8f1
Add Cifar dataset
fariedabuzaid Aug 1, 2025
3fe0386
Update Tests
fariedabuzaid Aug 2, 2025
8654f0e
Cleanup
fariedabuzaid Aug 2, 2025
f10359b
Fix imports
fariedabuzaid Aug 2, 2025
991051d
Update Pipeline
fariedabuzaid Aug 2, 2025
0ee197b
Update test
fariedabuzaid Aug 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,9 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: install setuptools
run: pip${{ matrix.python-version }} install setuptools
- name: Build requirments.txt
uses: divideprojects/poetry-export-requirements-action@v1
with:
without-hashes: true
outfile-name: requirements.txt
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
run: pip${{ matrix.python-version }} install -r requirements.txt
- name: Install pytest
run: pip${{ matrix.python-version }} install pytest
#----------------------------------------------
Expand Down
113 changes: 113 additions & 0 deletions experiments/cifar/cifar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
__object__: src.explib.base.ExperimentCollection
name: fashion_ablation
experiments:
- &exp_rad_logN
__object__: src.explib.hyperopt.HyperoptExperiment
name: cfair_full_radial_logN
skip: true
device: cpu
skip: true
scheduler: &scheduler
__object__: ray.tune.schedulers.ASHAScheduler
max_t: 1000000
grace_period: 1000000
reduction_factor: 2
num_hyperopt_samples: &num_hyperopt_samples 1
gpus_per_trial: &gpus_per_trial 0
cpus_per_trial: &cpus_per_trial 1
tuner_params: &tuner_params
metric: val_loss
mode: min
trial_config:
logging:
images: false
"image_shape": [28, 28]
dataset: &dataset
class:
__class__: src.explib.datasets.Cifar10Split
params:
space_to_depth_factor: 4
dataloc: /home/faried/Projects/USFlows/data/cifar10

epochs: &epochs 200000
patience: &patience 1
batch_size: &batch_size
__eval__: tune.choice([32])
optim_cfg: &optim
optimizer:
__class__: src.usflows.sophia.SophiaG
params:
lr:
__eval__: 1e-3
weight_decay: 0.0

model_cfg:
type:
__class__: src.usflows.flows.USFlow
params:
soft_training:
__eval__: tune.choice([False])
training_noise_prior:
__object__: pyro.distributions.Uniform
low:
__eval__: 1e-20
high: 0.01
prior_scale: 1.0
coupling_blocks:
__eval__: tune.choice([10])
lu_transform: 1
householder: 0
conditioner_cls:
__class__: src.usflows.networks.ConvNet2D
conditioner_args:
c_in: 48
c_hidden:
__eval__: tune.choice([32])
num_layers:
__eval__: tune.choice([3])
padding: same
kernel_size: 3
rescale_hidden: 1
normalize_layers:
__eval__: tune.choice([True])
gating:
__eval__: tune.choice([True])
in_dims: [48, 8, 8]
affine_conjugation: true
nonlinearity:
__eval__: tune.choice([torch.nn.ReLU()])
base_distribution:
__object__: src.usflows.distributions.RadialDistribution
device: cpu
p:
__eval__: float("1")
loc:
__eval__: torch.zeros([48, 8, 8]).to("cpu")
norm_distribution:
__object__: src.usflows.distributions.LogNormal
loc:
__eval__: torch.ones([1]).to("cpu") * 6
scale:
__eval__: torch.ones([1]).to("cpu") * .35
device: cpu
- &exp_normal
__overwrites__: *exp_rad_logN
name: fashion_full_laplace
skip: false
trial_config:
optim_cfg:
params:
lr:
__eval__: 1e-5
model_cfg:
params:
lu_transform: 0
affine_conjugation: false
base_distribution:
__exact__:
__object__: pyro.distributions.Normal
loc:
__eval__: torch.zeros([48, 8, 8]).to("cpu")
scale:
__eval__: torch.ones([48, 8, 8]).to("cpu")
106 changes: 62 additions & 44 deletions experiments/fashion/fashion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,92 +4,110 @@ name: fashion_ablation
experiments:
- &exp_rad_logN
__object__: src.explib.hyperopt.HyperoptExperiment
name: fashion_full_radial_logN
device: cuda
name: cfair_full_radial_logN
skip: true
device: cpu
skip: true
scheduler: &scheduler
__object__: ray.tune.schedulers.ASHAScheduler
max_t: 1000000
grace_period: 1000000
reduction_factor: 2
num_hyperopt_samples: &num_hyperopt_samples 1
gpus_per_trial: &gpus_per_trial 1
gpus_per_trial: &gpus_per_trial 0
cpus_per_trial: &cpus_per_trial 1
tuner_params: &tuner_params
metric: val_loss
mode: min
trial_config:
logging:
images: true
images: false
"image_shape": [28, 28]
dataset: &dataset
__object__: src.explib.datasets.FashionMnistSplit
class:
__class__: src.explib.datasets.FashionMnistSplit
params:
space_to_depth_factor: 4
dataloc: /home/faried/Projects/USFlows/data/fashion

epochs: &epochs 200000
patience: &patience 2
patience: &patience 1
batch_size: &batch_size
__eval__: tune.choice([32])
optim_cfg: &optim
optimizer:
__class__: torch.optim.Adam
__class__: src.usflows.sophia.SophiaG
params:
lr:
__eval__: 1e-4
__eval__: 1e-3
weight_decay: 0.0

model_cfg:
model_cfg:
type:
__class__: &model src.veriflow.flows.NiceFlow
__class__: src.usflows.flows.USFlow
params:
soft_training: true
soft_training:
__eval__: tune.choice([False])
training_noise_prior:
__object__: pyro.distributions.Uniform
low:
low:
__eval__: 1e-20
high: 0.01
prior_scale: 1.0
coupling_layers: 10
coupling_nn_layers: [300, 300, 300]
nonlinearity: &nonlinearity
coupling_blocks:
__eval__: tune.choice([10])
lu_transform: 1
householder: 0
conditioner_cls:
__class__: src.usflows.networks.ConvNet2D
conditioner_args:
c_in: 48
c_hidden:
__eval__: tune.choice([32])
num_layers:
__eval__: tune.choice([3])
padding: same
kernel_size: 3
rescale_hidden: 1
normalize_layers:
__eval__: tune.choice([True])
gating:
__eval__: tune.choice([True])
in_dims: [48, 8, 8]
affine_conjugation: true
nonlinearity:
__eval__: tune.choice([torch.nn.ReLU()])
split_dim: 392
base_distribution:
__object__: src.veriflow.distributions.RadialDistribution
device: cuda
p: 1.0
loc:
__eval__: torch.zeros(784).to("cuda")
base_distribution:
__object__: src.usflows.distributions.RadialDistribution
device: cpu
p:
__eval__: float("1")
loc:
__eval__: torch.zeros([48, 8, 8]).to("cpu")
norm_distribution:
__object__: pyro.distributions.LogNormal
loc:
__eval__: torch.zeros(1).to("cuda")
scale:
__eval__: (.5 * torch.ones(1)).to("cuda")
use_lu: true
- &exp_laplace
__overwrites__: *exp_rad_logN
name: fashion_full_laplace
skip: false
trial_config:
model_cfg:
params:
base_distribution:
__exact__:
__object__: pyro.distributions.Laplace
loc:
__eval__: torch.zeros(784).to("cuda")
scale:
__eval__: torch.ones(784).to("cuda")
__object__: src.usflows.distributions.LogNormal
loc:
__eval__: torch.ones([1]).to("cpu") * 6
scale:
__eval__: torch.ones([1]).to("cpu") * .35
device: cpu
- &exp_normal
__overwrites__: *exp_rad_logN
name: fashion_full_laplace
skip: false
trial_config:
optim_cfg:
params:
lr:
__eval__: 1e-5
model_cfg:
params:
lu_transform: 0
affine_conjugation: false
base_distribution:
__exact__:
__object__: pyro.distributions.Normal
loc:
__eval__: torch.zeros(784).to("cuda")
__eval__: torch.zeros([48, 8, 8]).to("cpu")
scale:
__eval__: torch.ones(784).to("cuda")
__eval__: torch.ones([48, 8, 8]).to("cpu")
Loading
Loading