rciric commited on
Commit
1e0a460
·
verified ·
1 Parent(s): f9c2602

Initial upload via tools/push_to_hf.py (architecture: ilex.models.krakencoder.Krakencoder)

Browse files
Files changed (3) hide show
  1. README.md +67 -0
  2. config.json +51 -0
  3. model.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: ilex
3
+ tags:
4
+ - jax
5
+ - equinox
6
+ - ilex
7
+ - neuroimaging
8
+ - brain-connectome
9
+ license: mit
10
+ license_link: https://opensource.org/licenses/MIT
11
+ ---
12
+
13
+ # Krakencoder -- joint brain connectome translation autoencoder -- Targlatent singleton -- SCifod2act_coco439_sift2volnorm
14
+
15
+ ## Description
16
+
17
+ Krakencoder (Jamison, Gu, Wang, Tozlu, Sabuncu, Kuceyeski, *Nature Methods* 2025), ported to JAX / Equinox from the upstream PyTorch release (github.com/kjamison/krakencoder). A linked autoencoder that simultaneously bidirectionally translates between structural and functional brain connectivity across different atlases and processing variants ('flavors') via a common 128-dim L2-normalised latent representation. The Nature Methods 2025 publication's canonical model jointly encodes 15 flavors (3 atlases × {3 functional connectivity types + 2 structural tractography types}) and maps each to / from the shared latent.
18
+ Architecture (per published recipe): per-flavor 256-dim PCA input transformation -> 256 -> 128 Linear encoder -> 128-dim L2-normalised latent -> 128 -> 256 Linear decoder -> inverse PCA to the destination flavor's full-dim connectivity space. v0 of this port ships the canonical bundle plus its 15-flavor PCA stack (separate ``krakencoder_pca_stack`` bundle that the ``KrakencoderPipeline`` co-loads).
19
+
20
+ ## Intended use
21
+
22
+ Single-flavor targlatent encoder/decoder for SCifod2act_coco439_sift2volnorm. Pairs with krakencoder_pca.SCifod2act-coco439-sift2volnorm-pc256.1; designed to be merged into the canonical 15-flavor bundle via KrakencoderPipeline.with_extra_flavor().
23
+
24
+ ## Usage
25
+
26
+ ```python
27
+ from ilex.models.krakencoder import Krakencoder
28
+ model = Krakencoder.from_pretrained('ilex-hub/krakencoder.SCifod2act-coco439-sift2volnorm-targlatent.1')
29
+ ```
30
+
31
+ ## Authors
32
+
33
+ Keith W. Jamison, Zijin Gu, Qinxin Wang, Ceren Tozlu, Mert R. Sabuncu, Amy Kuceyeski
34
+
35
+ ## Citation
36
+
37
+ Jamison K.W., Gu Z., Wang Q., Tozlu C., Sabuncu M.R., Kuceyeski A. (2025). Krakencoder: a unified brain connectome translation and fusion tool. Nature Methods. DOI: 10.1038/s41592-025-02706-2.
38
+
39
+ ### References
40
+
41
+ - Jamison K.W., Gu Z., Wang Q., Tozlu C., Sabuncu M.R., Kuceyeski A. (2025). Krakencoder: a unified brain connectome translation and fusion tool. Nature Methods. DOI: 10.1038/s41592-025-02706-2.
42
+ - Preprint: bioRxiv 10.1101/2024.04.12.589274.
43
+ - Upstream code: github.com/kjamison/krakencoder (model.py + fetch.py + per-flavor PCA transforms hosted on OSF: osf.io/dfp92).
44
+
45
+ ## License
46
+
47
+ HF Hub license tag: `mit`
48
+
49
+ **Effective terms:** MIT (copyright (c) 2024 Keith W. Jamison) on both the network code (github.com/kjamison/krakencoder) and the pretrained weights + per-flavor PCA transforms hosted on OSF (osf.io/dfp92). The ilex JAX / Equinox port code is separately licensed under Apache-2.0 / GPL-3.0.
50
+
51
+ Upstream license reference: https://opensource.org/licenses/MIT
52
+
53
+ ### Copyright
54
+
55
+ Network architecture, training code, and pretrained weights -- copyright (c) 2024 Keith W. Jamison; released under the MIT License. JAX / Equinox port code -- copyright (c) the ilex authors, released under the Apache-2.0 / GPL-3.0 dual license used by ilex itself.
56
+
57
+ ## Upstream source
58
+
59
+ Original weights / reference implementation: https://github.com/kjamison/krakencoder
60
+
61
+ ## Provenance
62
+
63
+ This artefact was produced by [ilex](https://github.com/hypercoil/ilex)'s
64
+ save/load pipeline. The architecture is implemented in
65
+ `ilex.models.krakencoder.Krakencoder` and the weights have been converted
66
+ from their upstream format. See the upstream source above
67
+ for the canonical reference.
config.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_ilex": {
3
+ "architecture": "ilex.models.krakencoder.model.Krakencoder",
4
+ "constructor_kwargs": {
5
+ "input_size_list": [
6
+ 256
7
+ ],
8
+ "latent_normalize": true,
9
+ "latentsize": 128,
10
+ "linear_include_bias": true
11
+ },
12
+ "flavor_name_list": [
13
+ "SCifod2act_coco439_sift2volnorm"
14
+ ],
15
+ "format": "ilex",
16
+ "framework_version": {
17
+ "equinox": "0.13.8",
18
+ "ilex": "0.0.0.dev0",
19
+ "jax": "0.10.0",
20
+ "jaxlib": "0.10.0",
21
+ "numpy": "2.4.4",
22
+ "safetensors": "0.7.0"
23
+ },
24
+ "has_state": false,
25
+ "origin": "ilex-native",
26
+ "weights_status": "bundled"
27
+ },
28
+ "authors": "Keith W. Jamison, Zijin Gu, Qinxin Wang, Ceren Tozlu, Mert R. Sabuncu, Amy Kuceyeski",
29
+ "copyright": "Network architecture, training code, and pretrained weights -- copyright (c) 2024 Keith W. Jamison; released under the MIT License. JAX / Equinox port code -- copyright (c) the ilex authors, released under the Apache-2.0 / GPL-3.0 dual license used by ilex itself.",
30
+ "data_type": "numpy",
31
+ "description": "Krakencoder (Jamison, Gu, Wang, Tozlu, Sabuncu, Kuceyeski, *Nature Methods* 2025), ported to JAX / Equinox from the upstream PyTorch release (github.com/kjamison/krakencoder). A linked autoencoder that simultaneously bidirectionally translates between structural and functional brain connectivity across different atlases and processing variants ('flavors') via a common 128-dim L2-normalised latent representation. The Nature Methods 2025 publication's canonical model jointly encodes 15 flavors (3 atlases \u00d7 {3 functional connectivity types + 2 structural tractography types}) and maps each to / from the shared latent.\nArchitecture (per published recipe): per-flavor 256-dim PCA input transformation -> 256 -> 128 Linear encoder -> 128-dim L2-normalised latent -> 128 -> 256 Linear decoder -> inverse PCA to the destination flavor's full-dim connectivity space. v0 of this port ships the canonical bundle plus its 15-flavor PCA stack (separate ``krakencoder_pca_stack`` bundle that the ``KrakencoderPipeline`` co-loads).",
32
+ "equinox_version": "0.13.8",
33
+ "ilex_version": "0.0.0.dev0",
34
+ "image_classes": "Brain connectivity matrices in any of the 15 supported flavors (per the canonical bundle's catalog row). Inputs are upper-triangular vectors -- one per flavor per subject. Atlas edge counts: FS86 = 3,655; Shen268 = 35,778; Coco439 = 96,141 (these are the full-dim sizes the per-flavor PCAs project from / inverse-project to).",
35
+ "intended_use": "Inference-time bidirectional translation between brain connectivity flavors via the shared latent representation. Pipeline:\n1. Caller provides input connectivity matrices (upper-triangular\n vectors) in one or more of the 15 supported flavors.\n2. ``KrakencoderPipeline`` runs each per-flavor PCA forward\n (full-dim -> 256-dim), encodes to the shared 128-dim\n L2-normalised latent, then optionally decodes to one or more\n target flavors and inverse-PCAs back to full dim.\n\nCommon use cases:\n* Translate input(s) in some flavors to predictions in others\n (the Nature Methods paper's primary application).\n* Extract the 128-dim shared latent as a subject-level\n representation for downstream prediction tasks (the\n ``.encode()`` shortcut).\n* Fusion: average multiple input flavors' latents to improve\n predictive identifiability.\n\nTrained on 700 subjects from the NIH Human Connectome Project; generalises to held-out HCP subjects and (per the paper) extends to non-HCP cohorts with some accuracy degradation.",
36
+ "jax_version": "0.10.0",
37
+ "network_data_format": {
38
+ "inputs": {},
39
+ "outputs": {}
40
+ },
41
+ "numpy_version": "2.4.4",
42
+ "pred_classes": "Outputs match the input shape: predicted connectivity matrices in the requested target flavor(s), as upper-triangular vectors at each flavor's atlas-determined edge count. The ``.encode()``-only shortcut emits a single (128,) L2-normalised latent per input subject.",
43
+ "references": [
44
+ "Jamison K.W., Gu Z., Wang Q., Tozlu C., Sabuncu M.R., Kuceyeski A. (2025). Krakencoder: a unified brain connectome translation and fusion tool. Nature Methods. DOI: 10.1038/s41592-025-02706-2.",
45
+ "Preprint: bioRxiv 10.1101/2024.04.12.589274.",
46
+ "Upstream code: github.com/kjamison/krakencoder (model.py + fetch.py + per-flavor PCA transforms hosted on OSF: osf.io/dfp92)."
47
+ ],
48
+ "schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_20240725.json",
49
+ "task": "brain-connectome translation (15 modality/atlas flavors via a shared latent space)",
50
+ "version": "0.0.0"
51
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e596d9b366dfac36b67c50a18fe2ed0434f40f30e26d5b25670e9b00bdb672d
3
+ size 264085