Skip to content

Latest commit

 

History

History
421 lines (377 loc) · 16 KB

Notes.md

File metadata and controls

421 lines (377 loc) · 16 KB

Notes and TODOs

To Remember :

  • path to setting.json on rci : /home/zorekmat/.vscode-server/data/Machine/settings.json

DRY_RUN=1 DATASET=airplane MODEL=poolmodel PATTERNS="mmd_*" LATENTS="gaussia_K1 vae_depth=2_hdim=12_zdim=16_K1 vae_depth=3_hdim=256_zdim=32_K1 vae_depth=3_hdim=256_zdim=64_K1" bash run_scripts/global_generative_evaluation_assignment.sh

  • I excluded : from git it is in .git/info/exclude to save memory of julia language server. /dev/ /scripts/ /figure_creation/

Todos 10.11.2026

  • extension of HSQVAE on mnist with cardinalites

    • constructor
    • dropouts
    • cardinality head
    • loss function
      • cardinality term
      • hungarian matching
      • masked chamfer distance version
    • elbo with logging
      • masked chamfer distance version
      • tested
    • optim step
    • valid step
  • chamfer_pairwised_distance masked version

    • implementation
    • testing
    • speedtesting on cuda
        Benchmark N=64, L=M=12, BS=32  (min time, ms) on Tesla V100-SXM2-32GB
                                CPU       GPU   speedup
        unmasked fwd           789.5      16.0     49.3x
        masked fwd             874.4      15.9     54.9x
        unmasked fwd+bwd       825.3      36.8     22.4x
        masked fwd+bwd         991.8      37.8     26.3x
      
        Benchmark N=64, L=M=12, BS=32  (min time, ms) on Tesla V100-SXM2-32GB
                                CPU       GPU   speedup
        unmasked fwd           475.1       5.4     88.3x
        masked fwd             566.9       7.9     72.1x
        unmasked fwd+bwd       490.9      21.1     23.2x
        masked fwd+bwd         602.6      23.9     25.2x
  • masked _pairwise_sqdist_batched

    • implementation
    • testing
    • speedtest
  • new masked version of chamfer distance with pairwise_sqdist_batched

    • implementation
    • testing
    • speedtest
    (d, n, bs) = (3, 512, 32)   GPU: Tesla V100-SXM2-32GB
    time [ms]                     CPU        GPU  GPU spdup
    old loop (masked) fwd        6.29      11.53       0.5x
    old loop (masked) fwd+bwd       52.0      55.92       0.9x
    new (masked) fwd           102.35       2.96      34.6x
    new (masked) fwd+bwd        103.8       4.72      22.0x
    unmasked fwd                20.31       2.84       7.2x
    unmasked fwd+bwd            21.61        4.0       5.4x
    
    (d, n, bs) = (3, 2048, 16)   GPU: Tesla V100-SXM2-32GB
    time [ms]                     CPU        GPU  GPU spdup
    old loop (masked) fwd        56.4      10.45       5.4x
    old loop (masked) fwd+bwd     478.85     113.55       4.2x
    new (masked) fwd            946.3      15.62      60.6x
    new (masked) fwd+bwd      1032.74      17.34      59.6x
    unmasked fwd                53.53      13.49       4.0x
    unmasked fwd+bwd            55.95      15.51       3.6x

Todos 13.10.2026

  • I did a lot of stuff for reconstruction and generation. But i did not log exact steps. i can do it ex-post

  • setvae - airplane - sh

    • if i have time, i should recompute this because i did not train these models.
  • train latent vae for poolmodel - airplanes

  • think about how to do generation on mnist. I think i think vae on latent might be necessary for PoolModel and setvae as well.

    • i think setvae needs better prior on the deepest variational layer. It might be interesting to test vae on deeper latent vs just sampling
    • setvae - vae latent
    • setvae - standard latent

Todos 5.9.2026

  • make rigorous comparision on Naive and DSQ models

  • Think about improvements to DSQ

    • i am starting to think that predicting cardinality/existence should be done early in decoder
    • for example existence at the end of decoder in DSQ might make everything more complicated, because model might spread information into more slots then will be later needed, this might make matching harder.
    • also matching can be different then existing prediction, this i think makes it harder for model too.
    • so setting cardinality frist and selecting/sampling queries early might be beneficial because model needs to focus only on this restricted set and have to turn it into desired output.
    • think about VQ-VAE for prior
      • we can sample queries from codebook
      • or we can predict existence of queries based on global latent. -> crossentropy for each code from codebook. What we will get is something like histogram or rather discrete probability for each code, then we can sample N codes based on their probability.

Todos 5.9.2026

  • i was working on experiments concerning generation of Discrete bags
  • I tested "naive" approach with and without cardinality prediction and it (surprisingly) worked quite well
  • experiments
    • prepare categorical mnist-like dataset for discrete bags

    • update DQSVAE

    • refactor HSQVAE

    • generalize and unify HungarianMatching and HungarianMatchingLoss

    • pairwise_logitcrossentropy

    • prepare NaiveSetModel

      • train script and all functions
      • run basic experiemnts
    • prepare NaiveSetModel with Cardinality Prediciton

      • train script and all functions
      • run basic experiements
    • DSQVAE for categorical data

      • train script and all functions
      • run basic experiements

Todos 21.8.2026

  • use CuIterator for training
  • Improve memory and speed on GPUs of Hungarian matching and pairwise chamfer distance.
    • we can work only with cartesian indexes and intermediate PDM to compute hungarian matching,
    • then when matching is found we can only compute with indexes we need for matching. we can save a lot of memory for gradients approximately HALF of it.
    • Might be useful even for HTD distance
  • HVAE training
    • data
      • dataset
      • dataloader
    • training script
    • HSVAE
      • struct
      • forward pass
      • constructor
      • elbo with logging
      • optim step
      • valid step
    • testing
      • test loading of data
      • test loss function
      • test traininig function
      • test all model functions
        • forward
        • constructor
        • elbo with logging
        • opt step
        • valid step

Todos 20.8.2026

  • sliced wasserstain impelementation

    • implement
    • sanity check
  • port DeepSlotQuerryVAE into GenerativeMIL

  • implement gpu-ready cluster pairwise Chamfer Distance

    • do sanity check if reshapeing is the same as if i run it in nested for loops
  • download MNIST PC data into MainGPU PC

  • train HSVAE (specialized for gaussian clock) - shape tests worked

    • implement hungarian matching with gpu pairwise evaluation for gaussian clock -> vit CPCD
      • implement hungarian part
      • sanity checks
    • implement forward and backward pass for HSVAE
      • it can be done via masking
    • test shallow setvae if it is better then poolmodel?
      • attention mask would allowed me to compute everything at once but PoolModel is also option.
      • but when i use attention inside i can put it also on the outside.

Todos 1.8.2026

saving update

  • update saving functions.
    • save config as JSON or YAML into results folder, so it is easier to load it later and run evaluation script on it.
      • It will also make results more reproducible, because we will know exactly what config was used for training.
    • save model as Flux.state and .jld2, so it is easier to load it later. This is also reason for saving config as JSON or YAML as it will be easier to reconstruct model from config and load state from .jld2 file.
  • think about .BSON -> this would be really good but i will not use it now.

Visualization and small experiment

  • make umap of arbitrary PoolModel on MNIST on E(x_i) and D(c) ... i.e. after pool encoder and after decoder (generator) before instance decoder
    • try to color it by classes and see if it is separated in latent space.
    • It my help understand how PoolModel works and if it is able to separate classes in latent space.
      • results are really nice, i think Neural Statistician might be nice as well. to see if "c" is actually used for anything
  • Neural Statistician
    • cd -> does not work. some classes are separete but mostly they overlay massively. that is not how latent space should look like.
    • l2 -> obviously much worse then NS-cd and even more then PoolModel.
  • SetVAE
    • shallow
    • [?] deep (think about this more)

retrain PoolModel on core5

  • poolmodel core5

Todos 30.7.2026

  • Evaluation (reconstruction)
    • mnist
      • neural statistician
      • poolmodel
      • setvae
    • airplane
      • neural statistician
      • poolmodel
      • setvae
    • core5
      • nerual statistician
      • poolmodel
      • setvae

Todos 24.7.2026

  • MNIST - PM - Sinkhorn -- can not be loaded -> needs retraining :/
  • most likely all neural statisticians too
    • mnist
      • l2
      • cd
      • dcd
      • sh
      • mmd
    • airplane
      • l2
      • cd
      • dcd
      • sh
      • mmd
    • core5
      • cd
      • l2
      • dcd (?)

Todos 21.7.2026

  • try to plot UMAP from top (the deepest) layer for encoder, to see if classes are separated somehow in latent space
  • try "guided" generation of samples
    • if umap and separation works then i can use centroids of classes in latent space to generate samples from specific class, which may be interesting for MNIST and ShapeNetCore (core5)
      • mnist
      • core5

reconstruction evaluation copyed from 7.7.2026

  • evaluation scripts
    • evaluate FINAL models
    • [y] !!OPTIONAL!! evaluate on checkpoint with best reconstruciton on validation set in given run. (possible to do)
      • prepare script to analyze histories and pick best checkpoint
      • script can evaluate best model and also last saved checkpoint (most likely final model)

Todos 13.7.2026

  • alpha = 1000 seems to be too high, it is better to use alpha=1, at least i think so according to data ->> was like day and night !!

train density aware chamfer distance

  • make config files
  • MNIST
    • poolmodel
      • dcd
    • neuralstatistician
      • dcd
    • setvae
      • dcd
      • cd (?)
        • cyclical
        • sigmoidal
        • linear (?)
  • airplane
    • poolmodel
      • dcd
    • neuralstatistician
      • dcd (need to retrain 1.8.2026)
    • setvae
      • dcd
        • cyclical (1-5 done, 6-10 in progress)
        • sigmoidal (?)
        • linear (?)
      • sh (?)
        • cyclical

Todos 8.7.2026

  • add special version of mmd and dcd for evaluation
    • dcd
    • mmd
  • density-aware chamfer distance
    • implement
    • start with only forward
    • write rrule or fast backward
    • cpu ready
    • make to gpu ready

Todos 7.7.2026

  • not able to load old PoolModel and NeuralStatistician (can with sinkhorn) -> retraining mnist
    • MNIST
      • poolmodel
        • cd
        • mmd
        • sh
      • neuralstatistician
        • cd
        • mmd
        • l2
    • airplane
      • poolmodel
        • cd
        • mmd (?)
        • sh (?)
      • neuralstatistician
        • l2
        • cd
        • mmd (?)
        • sh (?)
  • eval source code for renconstruction
    • implement
    • test on dummy case
    • test on real case (Poolmodel for example)

Todos 26.6.2026

  • implement regularized sinkhorn
    • froward
    • rrule
  • !!!! not possible for now, I can not backpropagate throughout solver, I could write it myself but I think it is not worth it now.

Todos 22.6.2026

  • sinkhorn divergence

    • implement it
    • custom rrule
    • testing on gpu
    • run with poolmodel first (then if it works add to setvae and neural statistician)
  • cyclic sinusoidal scheduler

    • implement
    • add to framework
    • test
    • apply to core5
  • use elbo and reconstruction terms as evaluation measures

    • mean and std per reconstruction
    • mean and std within class
    • mean and std within dataset ? ?

Todos 8.6.2026

  • Neural Statistician experiment
    • mix c and z from two different number (different classes)
      • the reconstruction should show us if information (about class or shape) is inside $z$ or $c$
      • I think $c$ will not be utilized that much or at all
      • we can take a look at loss with zdim=2 and zdim=32, we will see that one reaches much lower reconstruction loss then other, also kld_c will be close to zero. and kld_z will be high. all this points to situation in which most info is in $z$, and when I make bottleneck ($z$) tighter we have problems with reconstruction.

Todos 1.6.2026

  • Evaluation script

    • Coverage
    • Minimum Matching Distance
    • FID
    • 1-NNA
    • final script
  • ShapeNetCore Training / Experiments

    • SetVae training
      • I. Stage : Airplane (only)
      • II. Stage : airplane, car, chair, table, sofa
      • III. Stage : + rifle, lamp, watercraft, loudspeaker, display
    • PoolModel
      • I. Stage : Airplane (only)
      • II. Stage : airplane, car, chair, table, sofa
      • III. Stage : + rifle, lamp, watercraft, loudspeaker, display
    • NeuralStatistician
      • I. Stage : Airplane (only)
      • II. Stage : airplane, car, chair, table, sofa
      • III. Stage : + rifle, lamp, watercraft, loudspeaker, display
  • MNIST point cloud Experiments

    • NerualStatistician
      • l2
      • chamfer
      • mmd
  • ShapeNetCore dataset

    • download dataset
    • try to download 15K version used in PointFlow and SetVAE
    • write processing script
    • write loaders
      • write loader for 15K version
        • make loader so it can select specific classes
        • make loader that can pick multiple classes
          • add global normalization
      • write loader for our processed version from raw data
        • make loader so it can select specific classes
    • test functions
    • add normalization to loaders
    • pick intersting classes for all three stages

Todos 15.5.2026

  • update training
    • config generator

      • setvae
      • poolmodel
      • neural statistician
    • AdaMax to AdamW

    • MMD with EMA estimator for sigma

      • I striped type for valid_step and optim_step, dispatch is on elbo_with_logging
      • Also train_model and validation_check have now loss function as union Function and MMD_EMA_loss
      • code
      • incorporate to loss factory
      • final testing
      • add into config generator
      • fix valid_step and optim_step for poolmodel!!!!
    • new beta scheduler "step_linear"

      • it starts on inition value, stay on it till first milestone, then linearly ascend to max_value (final value)
      • final value is reached on second milestone and then beta is equal to final value till the end
      • implement step_linear scheduler using ParameterSchedulers.Sequence
      • prepare constructor so it can be built from yml config
      • add it into config generator
      • test it
    • add reconstruction loop for test set

      • write function
      • evaluate final model
      • evaluate best model
      • save to folder
      • save basic results like final loss (maybe final log), test loss
    • make new ModelNet dataset

      • download data
        • testing
        • rci
      • pick 10 interesting classes -> ["airplane", "car", "chair", "bed", "table", "sofa", "monitor", "lamp", "plant", "tent"]
      • sample points and save to file
        • version with balanced classes (at least a little -> min sample size)
      • prepare loading function
      • incorporate to create_dataloaders