dennys246 commited on
Commit
8a270f7
Β·
verified Β·
1 Parent(s): 6374609

Release v0.1.0

Browse files
Files changed (2) hide show
  1. MANIFEST.md +3 -2
  2. README.md +135 -0
MANIFEST.md CHANGED
@@ -5,7 +5,7 @@ Snapshot of a snowGAN training run, packaged for downstream consumers
5
 
6
  ## Provenance
7
  - snowGAN package version: `unknown`
8
- - snowGAN git SHA at release: `9d5b8e8d9b3996e417e70df6f024795529f000b8`
9
  - Training dataset: `rmdig/rocky_mountain_snowpack`
10
  - Source save_dir: `/mnt/d/GitSpot/snowGAN/keras/snowgan/core`
11
 
@@ -43,6 +43,7 @@ Snapshot of a snowGAN training run, packaged for downstream consumers
43
  - test_pool: 2 groups
44
 
45
  ## Artifacts
 
46
  - `discriminator.weights.h5`
47
  - `discriminator_config.json`
48
  - `discriminator_lowres.weights.h5`
@@ -52,4 +53,4 @@ Snapshot of a snowGAN training run, packaged for downstream consumers
52
  - `generator_fade_endpoints.weights.h5`
53
 
54
  ## Notes
55
- First core release. Trained ~127k steps without spectral_norm; disc loss diverged post-step-80k due to small dataset (~13 cores) + no Lipschitz constraint + unconstrained multiscale_disc lowres critic. Generator produces structured outputs (vertical snow-like patterns, blue/white palette). Backbone Conv3D features usable for transfer; full retrain with --spectral_norm planned for v0.2.0.
 
5
 
6
  ## Provenance
7
  - snowGAN package version: `unknown`
8
+ - snowGAN git SHA at release: `fde5671fed1b746962b6ca381e3a9b20ccf62e1c`
9
  - Training dataset: `rmdig/rocky_mountain_snowpack`
10
  - Source save_dir: `/mnt/d/GitSpot/snowGAN/keras/snowgan/core`
11
 
 
43
  - test_pool: 2 groups
44
 
45
  ## Artifacts
46
+ - `MANIFEST.md`
47
  - `discriminator.weights.h5`
48
  - `discriminator_config.json`
49
  - `discriminator_lowres.weights.h5`
 
53
  - `generator_fade_endpoints.weights.h5`
54
 
55
  ## Notes
56
+ First core release. Trained ~127k steps without spectral_norm (the v0.1.0 ms2 fade-step counter shows higher numbers but real training is ~127k). Disc loss diverged post-step-80k due to small dataset (~13 unique cores) + no Lipschitz constraint + unconstrained multiscale_disc lowres critic. Generator produces structured outputs (vertical snow-like patterns, blue/white palette) so the Conv3D backbone has learned meaningful features even if the final Dense head is noisy. Backbone usable for transfer learning; v0.2 planned with spectral_norm enabled for a stable retrain.
README.md CHANGED
@@ -1,3 +1,138 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ language:
4
+ - en
5
+ library_name: snowgan
6
+ pipeline_tag: image-generation
7
+ tags:
8
+ - gan
9
+ - wgan-gp
10
+ - image-generation
11
+ - snowpack
12
+ - transfer-learning
13
+ - modality-core
14
+ datasets:
15
+ - rmdig/rocky_mountain_snowpack
16
  ---
17
+
18
+ # snowGAN β€” core backbone (v0.1.0)
19
+
20
+ WGAN-GP trained on the
21
+ [Rocky Mountain Snowpack dataset](https://huggingface.co/datasets/rmdig/rocky_mountain_snowpack),
22
+ single-modality (`core`), depth=1, 1024x1024 resolution.
23
+ Published from the [snowGAN](https://github.com/dennys246/snowGAN) project for
24
+ downstream transfer-learning consumers.
25
+
26
+ ## How to use
27
+
28
+ The canonical consumer-side path uses [`snowgan.weights.fetch`](https://github.com/dennys246/snowGAN/blob/main/src/snowgan/weights.py)
29
+ to download + cache, then `snowgan.models.Discriminator` to rebuild and load:
30
+
31
+ ```python
32
+ from snowgan.weights import fetch
33
+ from snowgan.config import build
34
+ from snowgan.models.discriminator import Discriminator
35
+
36
+ # Fetch the release (cached locally after first call).
37
+ path = fetch("RMDig/snowGAN-core", "v0.1.0")
38
+
39
+ # Reconstruct the model from its sidecar config, then load weights.
40
+ cfg = build(str(path / "discriminator_config.json"))
41
+ disc = Discriminator(cfg)
42
+ disc.model.build((None, cfg.depth, cfg.resolution[0], cfg.resolution[1], cfg.channels))
43
+ disc.model.load_weights(str(path / "discriminator.weights.h5"))
44
+
45
+ # Tap the named features layer β€” the cross-repo contract with downstream consumers.
46
+ features = disc.model.get_layer("features")
47
+ print("backbone features:", features.output.shape) # (None, 1048576)
48
+ ```
49
+
50
+ Requires `pip install snowgan[hub]` (pulls in `huggingface_hub`). Without the
51
+ `[hub]` extra, `fetch()` raises a clean ImportError naming the missing dep.
52
+
53
+ ## Intended use
54
+
55
+ Primary use case is **transfer learning** β€” downstream classifiers (e.g. [AvAI](https://github.com/dennys246/AvAI)) attach task heads to the discriminator's Conv3D backbone via `model.get_layer("features").output`. Secondary use is generating synthetic core samples via the generator.
56
+
57
+ ## Architecture
58
+
59
+ | Field | Value |
60
+ | --- | --- |
61
+ | Modality | `core` (depth=1) |
62
+ | Resolution | 1024x1024 |
63
+ | Channels | 3 |
64
+ | Latent dim | 100 |
65
+ | Generator filter counts | `[1024, 512, 256, 128, 64]` |
66
+ | Discriminator filter counts | `[64, 128, 256, 512, 1024]` |
67
+ | Conv kernel / stride | `[3, 3]` / `[2, 2]` |
68
+ | Backbone (Flatten "features") dim | 1048576 |
69
+ | Final activation | `tanh` |
70
+
71
+ The discriminator's `Conv3D` layers use `ksize=(1, kH, kW)`, so the depth axis is
72
+ broadcast β€” kernels themselves are depth-agnostic. This is the contract that lets
73
+ downstream consumers compose multiple single-modality backbones into a depth=N model
74
+ (e.g. profile + core stacked at depth=2 for paired-modality transfer).
75
+
76
+ ## Training
77
+
78
+ Trained with WGAN-GP loss (Wasserstein + gradient penalty, Ξ»_gp=10.0)
79
+ on the core samples of [`rmdig/rocky_mountain_snowpack`](https://huggingface.co/datasets/rmdig/rocky_mountain_snowpack).
80
+ At release: `fade_step=130000`.
81
+
82
+ | Stabilizer | Setting |
83
+ | --- | --- |
84
+ | Spectral norm | `False` |
85
+ | Differentiable augmentation | `True` |
86
+ | Adaptive augmentation (ADA) target | `0.6` |
87
+ | Adaptive disc/gen step ratio | `False` |
88
+ | EMA decay (generator shadow) | `0.999` |
89
+ | Multi-scale discriminator | `True` |
90
+ | Gradient clip (global norm) | `1.0` |
91
+ | LR decay schedule | `cosine` (lr_min=`1e-07`) |
92
+ | FID eval interval | `5000` steps |
93
+
94
+ ### Dataset splits
95
+
96
+ Splits are deterministic at the `(site, column, core)` group level (seed=42),
97
+ persisted in both sidecar configs so downstream consumers (e.g. AvAI) evaluate
98
+ on the same held-out cores the GAN never saw:
99
+
100
+ - `trained_pool`: 10 groups
101
+ - `validation_pool`: 1 groups
102
+ - `test_pool`: 2 groups
103
+
104
+ ## Limitations
105
+
106
+ - Trained on the core modality of rmdig/rocky_mountain_snowpack; generalization untested.
107
+ - Late-training discriminator divergence: disc loss plateaued at large magnitudes (~28k abs-mean) from step ~80k onward. The Conv3D backbone features are still informative (the generator learns structured outputs) but the final Dense head is noisy. AvAI only taps the named features layer (before the final Dense) so the noisy Dense is harmless for transfer.
108
+ - Single-modality backbone (depth=1); paired-modality features must be composed on the consumer side. See AvAIs load_backbones for the canonical two-backbone composition pattern.
109
+ - Small held-out test_pool (2 groups) due to the underlying datasets ~13 unique cores. Downstream evaluation metrics will be noisy.
110
+ - Trained without spectral_norm; planned for v0.2 retrain.
111
+
112
+ ## Files in this release
113
+
114
+ - `discriminator.weights.h5` β€” main discriminator weights (the transfer backbone).
115
+ - `discriminator_config.json` β€” architecture sidecar; pass to `snowgan.models.Discriminator(cfg)`.
116
+ - `generator.weights.h5` + `generator_config.json` β€” generator weights and sidecar.
117
+ - `generator_ema.weights.h5` β€” EMA shadow weights (only if EMA was enabled during training).
118
+ - `generator_fade_endpoints.weights.h5` β€” progressive-fade toRGB endpoints (only if fade was used).
119
+ - `discriminator_lowres.weights.h5` β€” multi-scale 256Γ—256 critic (only if multiscale_disc was on).
120
+ - `MANIFEST.md` β€” full provenance dump (git SHA, every training flag, every artifact). Read this for debugging.
121
+ - `README.md` β€” this file.
122
+
123
+ ## License
124
+
125
+ Apache 2.0 β€” see the [snowGAN repository](https://github.com/dennys246/snowGAN) for the full license text.
126
+
127
+ ## Cross-references
128
+
129
+ - **Source code**: [github.com/dennys246/snowGAN](https://github.com/dennys246/snowGAN)
130
+ - **Downstream transfer-learning project**: [github.com/dennys246/AvAI](https://github.com/dennys246/AvAI)
131
+ - **Companion modality backbones**:
132
+ [`RMDig/snowGAN-magnified-profile`](https://huggingface.co/RMDig/snowGAN-magnified-profile),
133
+ [`RMDig/snowGAN-core`](https://huggingface.co/RMDig/snowGAN-core)
134
+ - **Training dataset**: [`rmdig/rocky_mountain_snowpack`](https://huggingface.co/datasets/rmdig/rocky_mountain_snowpack)
135
+
136
+ ## Release notes
137
+
138
+ First core release. Trained ~127k steps without spectral_norm (the v0.1.0 ms2 fade-step counter shows higher numbers but real training is ~127k). Disc loss diverged post-step-80k due to small dataset (~13 unique cores) + no Lipschitz constraint + unconstrained multiscale_disc lowres critic. Generator produces structured outputs (vertical snow-like patterns, blue/white palette) so the Conv3D backbone has learned meaningful features even if the final Dense head is noisy. Backbone usable for transfer learning; v0.2 planned with spectral_norm enabled for a stable retrain.