Metadata-Version: 2.1
Name: torchradio
Version: 0.0.2
Summary: A PyTorch differentiable RF simulation environment
Project-URL: Homepage, https://github.com/dewcservices/torchradio
Project-URL: Bug Tracker, https://github.com/dewcservices/torchradio/issues
Author-email: Daniel Gibbons <daniel.gibbons@dewc.com>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: chart-studio
Requires-Dist: ipykernel
Requires-Dist: ipywidgets
Requires-Dist: kaleido
Requires-Dist: loguru
Requires-Dist: matplotlib
Requires-Dist: nbformat
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: scikit-commpy
Requires-Dist: scipy
Requires-Dist: torch
Requires-Dist: tqdm
Requires-Dist: types-tqdm
Requires-Dist: widgetsnbextension
Provides-Extra: dev
Requires-Dist: black; extra == 'dev'
Requires-Dist: black[jupyter]; extra == 'dev'
Requires-Dist: coverage; extra == 'dev'
Requires-Dist: lefthook; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: nbqa; extra == 'dev'
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Requires-Dist: torchradio[docs]; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs; extra == 'docs'
Requires-Dist: mkdocs-jupyter; extra == 'docs'
Requires-Dist: mkdocs-material; extra == 'docs'
Requires-Dist: mkdocstrings[python]; extra == 'docs'
Requires-Dist: mknotebooks; extra == 'docs'
Requires-Dist: pymdown-extensions; extra == 'docs'
Description-Content-Type: text/markdown

[![](https://github.com/dewcservices/torchradio/actions/workflows/python.yml/badge.svg)](https://github.com/dewcservices/torchradio/actions/workflows/python.yml)

# Torchradio

A differentiable RF simulation environment written in PyTorch.

> [!NOTE]
> `torchradio` is *not* affiliated with the official PyTorch project and should not be considered as a PyTorch-supported library like `torchvision` or `torchaudio`.

## Overview
`torchradio` provides an ecosystem for creating novel radios using machine learning. Specifically, `torchradio` lets engineers train parameterized radios with gradient-based methods using [PyTorch](https://pytorch.org/). `torchradio` accomplishes this by modelling common RF effects with auto-differentiable blocks that allow gradients to backpropagate from an objective function.

## Why are gradients important?
The gradient tells us in what direction we should adjust our parameters to immediately improve performance. Without this information, we can usually only improve performance via guess-and-check. That is, guess some new parameters, re-evaluate the objective function, and see whether performance improved. The gradient removes much of this guesswork by providing an explicit direction for the next parameter update. This information is critical when parameter space has thousands, millions, or even billions of dimensions.

Gradients are **not** essential for optimization. There exist many gradient-free optimization methods that do not require specialized simulation environments such as `torchradio`. Gradient-free methods allow users to optimize parameters with relatively simple techniques based on random search. Unfortunately these methods scale poorly as the number of parameters increases and are rarely used in conjunction with parameter-rich algorithms like deep neural networks (though there are some notable counter-examples such as [https://arxiv.org/pdf/1703.03864.pdf](https://arxiv.org/pdf/1703.03864.pdf)).

## Assumptions
- All events take place at baseband.
- All devices have the same centre frequency and bandwidth.
- `torchradio` is not intended to replace a high-fidelity simulation. Rather, it is a training ground for developing novel radios. If a radio looks promising, its parameters can be exported for testing in a high-fidelity simulation environment.

## Installation

Install the `torchradio` package by running:

```
pip install git+https://github.com/dewcservices/torchradio.git
```

## Contributing

New contributors are always welcome! If you would like to contribute, it is recommended you set up your development environment using the following instructions.

Create a new Python virtual environment using your method of choice (e.g., `venv`, `conda`, `pyenv` etc.). Clone this repository and install using

```
pip install -e .[dev]
```

The above command will install `torchradio` along with its core dependencies, as well as dev-specific dependencies for formatting, linting and testing. The `-e` flag installs `torchradio` in editable mode, so you can quickly see the effects of local source code changes without reinstalling `torchradio`. You can test that everything is working as expected by running

```
pytest
```

To save failing GitHub Actions due to styling issues, set up the project's git hooks using:

```
pre-commit install
pre-commit run --all-files
```

You can view the documentation locally anytime by running:

```
mkdocs serve
```
