Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ share/python-wheels/
*.egg
MANIFEST
*.json
# ...but these are source, not per-experiment output. The blanket *.json above was
# added to keep local sweep configs out (7ff2088); it would otherwise swallow the
# migration table, the test fixtures and the migrator itself.
!unit_tests/fixtures/**/*.json
!migration/*.json
*.yaml
*.nii
*.nii.gz
Expand Down
29 changes: 29 additions & 0 deletions migration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# docs

## `hash_migration.json`

`segtransferaug/run_trainings.py` names each experiment directory

Dataset{id}-{trainer}-aug-{transform_hash}-c-{config_hash}

where `config_hash` is a sha256 over the canonical JSON of the config and
`transform_hash` is a sha256 over the text of `smauglab/transforms/gpu/transforms.py`.

The registry migration moved both: every config was rewritten to class-name keys, and
the GPU builder that file contained was replaced by a registry-driven one. Runs made
before the migration keep their old directory names, so anything that looks a run up
by hash needs this table. The canonicalisation itself is unchanged and is asserted
byte-for-byte against the original implementation, so a config that did not change
would still hash the same.

Two old hashes map to configs that are now byte-identical:

* `0b639cf1` covered `transform_params_gpu_default01-23.json` and
`transform_params_one-sequence-to-segment-them-all.json`, which had the same content
all along under different names.
* `transform_params_gpu_default01-23_ICGT_plus.json` had its own hash only because of
the dead `ImageContrastGPUTransform` block; with that gone it is a duplicate of
`default01-23`.

Known consumer, updated to accept both: `segtransferaug/refinement/config.py`, whose
`DOMAIN_TRANSFER_HASHES` selects the fusion source pool.
471 changes: 471 additions & 0 deletions migration/migrate.py

Large diffs are not rendered by default.

238 changes: 142 additions & 96 deletions smauglab/configs/transform_params.json
Original file line number Diff line number Diff line change
@@ -1,98 +1,144 @@
{
"retain_stats": true,
"mirror_axes": [0,1,2],
"ArtifactTransform": {
"motion": false,
"ghosting": false,
"spike": false,
"bias_field": false,
"blur": false,
"noise": false,
"swap": false,
"random_pick": false,
"probability": 0.7
},
"SpatialCustomTransform": {
"flip": false,
"affine": false,
"elastic": false,
"anisotropy": false,
"random_pick": false,
"probability": 0.6
},
"ConvTransform": {
"kernel_type": "Laplace",
"absolute": false,
"retain_stats": false,
"probability": 0.15
},
"RedistributeTransform": {
"classes": null,
"in_seg": 0.2,
"retain_stats": false,
"probability": 0.5
},
"ShapeTransform": {
"shape_min": 1,
"ignore_axes": [1,2],
"probability": 0.4
},
"HistogramEqualTransform": {
"probability": 0.1
},
"FunctionTransform": {
"probability": 0.05
},
"GaussianNoiseTransform": {
"noise_variance": [0, 0.1],
"p_per_channel": 1,
"synchronize_channels": true,
"probability": 0.1
},
"GaussianBlurTransform": {
"blur_sigma": [0.5, 1.0],
"synchronize_channels": false,
"synchronize_axes": false,
"p_per_channel": 0.5,
"benchmark": true,
"probability": 0.2
},
"MultiplicativeBrightnessTransform": {
"multiplier_range": [0.75, 1.25],
"synchronize_channels": false,
"p_per_channel": 1,
"probability": 0.15
},
"ContrastTransform": {
"contrast_range": [0.75, 1.25],
"preserve_range": true,
"synchronize_channels": false,
"p_per_channel": 1,
"probability": 0.15
},
"SimulateLowResolutionTransform": {
"scale": [0.3, 1],
"synchronize_channels": true,
"synchronize_axes": false,
"ignore_axes": [],
"allowed_channels": null,
"p_per_channel": 0.5,
"probability": 0.2
},
"GammaTransform_invert": {
"gamma": [0.7, 1.5],
"p_invert_image": 1,
"synchronize_channels": false,
"p_per_channel": 1,
"p_retain_stats": 1,
"probability": 0.1
},
"GammaTransform": {
"gamma": [0.7, 1.5],
"p_invert_image": 0,
"synchronize_channels": false,
"p_per_channel": 1,
"p_retain_stats": 1,
"probability": 0.3
}
"CPU": {
"LaplaceConvTransform": {
"absolute": false,
"retain_stats": true,
"p": 0.15
},
"Log1pTransform": {
"p": 0.05,
"retain_stats": true
},
"SqrtTransform": {
"p": 0.05,
"retain_stats": true
},
"SinTransform": {
"p": 0.05,
"retain_stats": true
},
"ExpTransform": {
"p": 0.05,
"retain_stats": true
},
"SigmoidTransform": {
"p": 0.05,
"retain_stats": true
},
"HistogramEqualTransform": {
"p": 0.1,
"retain_stats": true
},
"RedistributeTransform": {
"in_seg": 0.2,
"retain_stats": true,
"p": 0.5
},
"ShapeTransform": {
"shape_min": 1,
"ignore_axes": [
1,
2
],
"p": 0.4
},
"ArtifactTransform": {
"motion": false,
"ghosting": false,
"spike": false,
"bias_field": false,
"blur": false,
"noise": false,
"swap": false,
"random_pick": false,
"p": 0.7
},
"SpatialCustomTransform": {
"flip": false,
"affine": false,
"elastic": false,
"anisotropy": false,
"random_pick": false,
"p": 0.6
},
"GaussianNoiseTransform": {
"noise_variance": [
0,
0.1
],
"p_per_channel": 1,
"synchronize_channels": true,
"p": 0.1
},
"GaussianBlurTransform": {
"blur_sigma": [
0.5,
1.0
],
"synchronize_channels": false,
"synchronize_axes": false,
"p_per_channel": 0.5,
"benchmark": true,
"p": 0.2
},
"MultiplicativeBrightnessTransform": {
"multiplier_range": [
0.75,
1.25
],
"synchronize_channels": false,
"p_per_channel": 1,
"p": 0.15
},
"ContrastTransform": {
"contrast_range": [
0.75,
1.25
],
"preserve_range": true,
"synchronize_channels": false,
"p_per_channel": 1,
"p": 0.15
},
"SimulateLowResolutionTransform": {
"scale": [
0.3,
1
],
"synchronize_channels": true,
"synchronize_axes": false,
"ignore_axes": [],
"allowed_channels": null,
"p_per_channel": 0.5,
"p": 0.2
},
"InvertedGammaTransform": {
"gamma": [
0.7,
1.5
],
"synchronize_channels": false,
"p_per_channel": 1,
"p_retain_stats": 1,
"p": 0.1
},
"GammaTransform": {
"gamma": [
0.7,
1.5
],
"p_invert_image": 0,
"synchronize_channels": false,
"p_per_channel": 1,
"p_retain_stats": 1,
"p": 0.3
},
"MirrorTransform": {
"allowed_axes": [
0,
1,
2
]
}
}
}
Loading
Loading