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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pip install deepinv[benchmarks]
and then run on python:

```python
from deepinv.benchmarks import run_benchmark
from deepinv_bench import run_benchmark
my_solver = lambda y, physics: ... # your solver here
results = run_benchmark(my_solver, "benchmark_name")
```
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[build-system]
requires = ["setuptools>=61.0.0"]
build-backend = "setuptools.build_meta"

[project]
name = "deepinv_bench"
version = "0.0.1"
dependencies = [
"torch",
"deepinv",
"benchopt"
]
23 changes: 23 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import deepinv as dinv
import torch
import benchopt

def run_benchmark(model : dinv.models.Reconstructor | torch.nn.Module, benchmark_name : str):
r"""
Run a benchmark on a given model.


:param dinv.models.Reconstructor | torch.nn.Module model:
:param str benchmark_name: Name of the benchmark to run.
:return: dict with benchmark results, including metrics and runtime.
"""

# TODO: how can we do this with benchopt?

return results


if __name__ == "__main__":
solver = dinv.models.RAM()
results = run_benchmark(solver, "div2k_gaussian_deblurring")
print(results)
Loading