Skip to content
Merged
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
10 changes: 7 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ exclude =
__pycache__,
build,
dist,
.venv,
.tox,
versioneer.py,
ganrc/_version.py,
ganrec/_version.py,
ganrectf/_version.py,
ganrectorch/_version.py,
docs/source/conf.py
ignore = E501, W503 # This comment should not be part of the ignore option
max-line-length = 88
max-line-length = 115
extend-ignore = E203, W503
43 changes: 25 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# GANrec: A GAN-based data reconstruction framework

![PyPI](https://img.shields.io/pypi/v/ganrec)
![Python Version](https://img.shields.io/pypi/pyversions/ganrec)
![License](https://img.shields.io/pypi/l/ganrec)
[![CI](https://github.com/XYangXRay/ganrec/actions/workflows/python-app.yml/badge.svg)](https://github.com/XYangXRay/ganrec/actions/workflows/python-app.yml)

## Overview

GANrec is an data reconstruction framework that harnesses the power of Generative Adversarial Networks (GANs). While traditional reconstruction methods primarily rely on intricate algorithms to piece together fragmented data, GANrec employs the generative capabilities of GANs to reimagine and revitalize data reconstruction.
Expand All @@ -15,9 +20,23 @@ Originally designed for the fields of tomography and phase retrieval, GANrec shi

## Installation

This guide provides two ways to set up `ganrec`:
- With Pixi (recommended, reproducible): default TensorFlow+CUDA backend with an optional PyTorch-only backend.
- With Conda/pip (alternative): manual setup.
The simplest way is pip. Pixi and Conda sections below show example runtime environments.

### Pip (quickest)

Install GANrec with your preferred backend in one step using extras:

```bash
# TensorFlow backend
pip install "ganrec[tensorflow]"

# PyTorch backend
pip install "ganrec[pytorch]"
```

Notes:
- For TensorFlow GPU wheels, see TensorFlow’s docs (e.g., tensorflow[and-cuda]) and ensure compatible NVIDIA drivers/CUDA.
- For PyTorch, use the selector on pytorch.org for OS/CUDA-specific commands if the generic wheel doesn’t match your system.

### Pixi (recommended)

Expand Down Expand Up @@ -50,7 +69,7 @@ Quick start with Pixi:

Note: Environments are defined in `pyproject.toml` — `default` uses TensorFlow; `pytorch` uses PyTorch.

### Conda environment
### Conda environment (example runtime)

#### 1. Create & Activate a Conda Environment
Open your terminal or command prompt and create a new conda environment named `ganrec` with Python 3.11:
Expand All @@ -60,20 +79,8 @@ conda create --name ganrec python=3.11
conda activate ganrec
```

#### 2. Install ganrec with your preferred backend (recommended)
Use pip extras to install GANrec and the backend in one step:

```bash
# TensorFlow backend
pip install "ganrec[tensorflow]"

# PyTorch backend
pip install "ganrec[pytorch]"
```

Notes:
- For TensorFlow GPU wheels, see TensorFlow’s docs (e.g., tensorflow[and-cuda]) and ensure compatible NVIDIA drivers/CUDA.
- For PyTorch, use the selector on pytorch.org for OS/CUDA-specific commands if the generic wheel doesn’t match your system.
#### 2. Install ganrec with your preferred backend
Then install via pip extras as above.


## Additional Notes for Users
Expand Down
28 changes: 16 additions & 12 deletions examples/tomography_tf.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ dependencies = [
]

[project.optional-dependencies]
tensorflow = ["tensorflow>=2.0.0"]
tensorflow = [
"tensorflow[and-cuda]>=2.17.0",
]
pytorch = [
"torch>=2.0.0",
"torchvision",
Expand Down