File size: 1,604 Bytes
92be5d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
license: other
library_name: jax
tags:
- nanopore
- signal-reconstruction
- audio-codec
- flax
- jax
pipeline_tag: feature-extraction
---

# NanoRecon

NanoRecon is a Flax/JAX SimVQ-based model for nanopore signal reconstruction. This repository contains inference-ready model weights and the matching architecture config.

## Files

- `flax_model.msgpack`: Flax variables for inference only, containing `params` and mutable `vq` codebook variables.
- `config.json`: model architecture and signal-shape metadata needed to instantiate the model.

The uploaded package is limited to inference assets and does not include local machine paths or private dataset references.

## Loading Example

```python
import json
from pathlib import Path

import jax
import jax.numpy as jnp
from flax.core import freeze
from flax.serialization import from_bytes

from codec.models import build_audio_model

repo_dir = Path("/path/to/NanoRecon")
cfg = json.loads((repo_dir / "config.json").read_text())
model = build_audio_model(cfg["model"])

variables = from_bytes(freeze({"params": {}, "vq": {}}), (repo_dir / "flax_model.msgpack").read_bytes())

x = jnp.zeros((1, cfg["input_signal"]["segment_samples"]), dtype=jnp.float32)
rng = jax.random.PRNGKey(0)
out = model.apply(
    variables,
    x,
    offset=0,
    rng=rng,
    collect_codebook_stats=False,
)
reconstructed = out["wave_hat"]
```

## Notes

This model expects normalized nanopore signal chunks with shape `(batch, samples)`. The exported config records the expected chunk size and sample rate.

## Citation

No citation metadata has been provided yet.