NanoRecon / README.md
GHSSHG's picture
Upload NanoRecon inference assets
92be5d5 verified
---
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.