Jacob Garcia · Hugging Face Model Foundry

Neural Process Pocket Lab

Interactive few-shot function distribution inference. This showcase backs up the trained artifacts, measured evaluation, and complete runnable source.

Explore every file View the full foundry

Verified project card

# Neural Process Pocket

Neural Process Pocket is a Conditional Neural Process trained across a
distribution of sine functions. Five unordered context observations are encoded
into a task representation; a probabilistic decoder predicts the mean and
standard deviation at arbitrary target coordinates.

Evaluation covers RMSE, Gaussian negative log likelihood, and empirical 90%
interval coverage on unseen functions. A fixed-kernel RBF Gaussian Process is the
non-neural few-shot control.

## Verified local result

The 12,866-parameter CNP reached 1.093 RMSE, 1.242 Gaussian NLL, and 88.76%
coverage for nominal 90% intervals across 500 unseen five-context-point tasks.
The fixed-kernel Gaussian Process reached 1.259 RMSE, 1.328 NLL, and 73.63%
coverage.

```bash
uv run python projects/neural-process-pocket/train.py
uv run pytest tests/test_neural_process_pocket.py
```

Evaluation snapshot

{
  "model": "Neural Process Pocket",
  "parameters": 12866,
  "best_step": 5000,
  "benchmark": {
    "conditional_neural_process": {
      "rmse": 1.092705488204956,
      "gaussian_nll": 1.241895318031311,
      "coverage_90": 0.8876199722290039
    },
    "fixed_rbf_gaussian_process": {
      "rmse": 1.2585044517936235,
      "gaussian_nll": 1.3279816679794703,
      "coverage_90": 0.73632
    },
    "tasks": 500,
    "context_points_per_task": 5,
    "targets_per_task": 100
  }
}

Backed-up artifact tree

  • README.md
  • __pycache__/app.cpython-311.pyc
  • __pycache__/model.cpython-311.pyc
  • app.py
  • artifacts/neural-process-pocket/evaluation.json
  • artifacts/neural-process-pocket/model.safetensors
  • data/heldout_tasks.parquet
  • model.py
  • requirements.txt
  • train.py