Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
aceaf9b
Delete obsolete simulation module
aknierim Nov 26, 2025
f88dbc3
Add pydantic-based configuration system
aknierim Nov 26, 2025
972bcb2
Add callbacks config system
aknierim Nov 27, 2025
41cc96d
Add logging config system
aknierim Nov 27, 2025
a9ee2f3
Add device and misc config system
aknierim Nov 27, 2025
0b6332a
Add main training module
aknierim Nov 27, 2025
13bcdb0
Add training module init
aknierim Nov 27, 2025
03e0a8b
Remove training utils.py and scripts dir
aknierim Nov 27, 2025
bd64385
Update quickstart cli tool for new cli
aknierim Nov 27, 2025
600bc2d
Add main model op cli tool
aknierim Nov 27, 2025
c22c5c3
Add main cli tool
aknierim Nov 27, 2025
28539f2
Add radionets.io.data submodule and H5Dataset class
aknierim Nov 27, 2025
19b33cd
Add H5 Lightning DataModule
aknierim Nov 27, 2025
3e019b6
Add WebDataset Lightning DataModule
aknierim Nov 27, 2025
77f2f87
Add __init__ and update docstrings
aknierim Nov 27, 2025
67b8532
Add ifft and symmetry functions
aknierim Nov 27, 2025
f73bd02
Add new callbacks main class
aknierim Nov 27, 2025
d357dc3
Add CometCallback for figure logging
aknierim Nov 27, 2025
3f68c34
Add logging handler main class
aknierim Nov 27, 2025
59c7f66
Add kwargs to _create_blocks
aknierim Nov 27, 2025
707438b
Add loss submodule and loss classes
aknierim Nov 27, 2025
821a194
Add plotting utility functions
aknierim Nov 27, 2025
e219d79
Add utils module and path validation function
aknierim Nov 27, 2025
1858ea5
Add codecarbon utils
aknierim Nov 27, 2025
65628c1
Remove obsolete core.data submodule
aknierim Nov 27, 2025
57ad2ef
Remove obsolete core.model submodule
aknierim Nov 27, 2025
95dbcd9
Remove obsolete core.learner submodule
aknierim Nov 27, 2025
238035a
Remove obsolete core.utils submodule
aknierim Nov 27, 2025
116c39b
Remove obsolete core.loss_functions submodule
aknierim Nov 27, 2025
034f552
Change project scripts to main CLI
aknierim Nov 27, 2025
08ed0cb
Remove simulation tests
aknierim Nov 27, 2025
a0003e6
Add code of conduct
aknierim Nov 27, 2025
f59951e
Rename unc_archs -> uncertainty_archs
aknierim Nov 28, 2025
25c401d
Remove old imports from core.__init__, add only Callbacks, Loggers cl…
aknierim Dec 2, 2025
6ed5754
Remove blob detecttion submodule
aknierim Dec 2, 2025
ad02109
Add refactored blob detection as feature submodule
aknierim Dec 2, 2025
90761c1
Refactore contour submodule
aknierim Dec 2, 2025
aa80077
Refactore dynamic_range submodule
aknierim Dec 2, 2025
f08134d
Add misc configs
aknierim Dec 2, 2025
ea3ccc9
Import annotations from __future__ for type checking
aknierim Dec 2, 2025
5263867
Remove obsolete evaluation scripts
aknierim Dec 2, 2025
36fdeac
Fix typo ndimage -> ndarray
aknierim Dec 2, 2025
a425ab4
Fix apply_symmetry call in CometCallback
aknierim Dec 2, 2025
61d3063
Fix apply_symmetry function in evaluation utils
aknierim Dec 2, 2025
1aceaf0
Restructure main training config
aknierim Dec 3, 2025
59add90
Move io._callbacks to io.training_.callbacks
aknierim Dec 3, 2025
3061712
Move io._logging to io.training_.logging, add codecarbon to logging
aknierim Dec 3, 2025
5964689
Remove GeneralConfig class and training-related parts to new io.train…
aknierim Dec 3, 2025
03ee45b
Move DeviceConfig to train_config.py, move DeepSpeedConfig to io.trai…
aknierim Dec 3, 2025
a53c719
Import all subconfigs from io.training.__init__
aknierim Dec 3, 2025
bcaa754
Update restructured default config
aknierim Dec 3, 2025
b592d9e
Update attributes to match config structure
aknierim Dec 3, 2025
130abd3
Update attributes to match config structure
aknierim Dec 3, 2025
ab68826
Update attributes to match config structure
aknierim Dec 3, 2025
29483fa
Refactor evaluation.jet_angle
aknierim Dec 3, 2025
ef3c2bf
Remove codecarbon from default config
aknierim Dec 3, 2025
cde78a7
Fix docstrings
aknierim Dec 3, 2025
6e9e2c1
Fix import typo
aknierim Dec 4, 2025
404bb2d
Add baseclass for after val epoch figure logging, add MLFLow callback
aknierim Dec 4, 2025
6789033
Add on_fit_end codecarbon logging for mlflow
aknierim Dec 4, 2025
7756e9a
Fix config paths/uri
aknierim Dec 4, 2025
a24a993
Add codecarbon to on_predict_end and on_test_end for mlflow
aknierim Dec 5, 2025
e4260c9
Refactor evaluation.jets
aknierim Dec 8, 2025
b52c529
Add codespell and sphinx-lint
aknierim Dec 9, 2025
e0a4fd4
Add mypy and update pytest ini opts
aknierim Dec 9, 2025
5abe265
Add missing __future__ annotations import
aknierim Dec 9, 2025
acdcdd5
Fix wrong import of _setup_logger function
aknierim Dec 9, 2025
78f59d2
Rename utils.codecarbon to utils.carbon_tracking to avoid namespace c…
aknierim Dec 9, 2025
55871e6
Update carbon_tracking import
aknierim Dec 9, 2025
0544f41
Merge branch 'main' into lightning
aknierim Dec 9, 2025
bef2db2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 9, 2025
fa50d60
Allow skipping the CI
aknierim Dec 9, 2025
9d26391
Merge branch 'lightning' of github.com:radionets-project/radionets in…
aknierim Dec 9, 2025
0cdb126
Fix typos reported by codespell
aknierim Dec 9, 2025
fe8e693
Add codespell settings
aknierim Dec 9, 2025
f49360d
Remove obsolete pointsources submodule
aknierim Dec 10, 2025
3b4b566
Fix loss classes
aknierim Dec 12, 2025
ac861f4
Add source area ratio callback
aknierim Dec 16, 2025
4f68927
Fix bug where _compute_source_area function would receive generator i…
aknierim Dec 16, 2025
5eebf07
Log model name and dataset name parameters in mlflow
aknierim Dec 16, 2025
7c6482c
Fix codecarbon mlflow callback
aknierim Dec 17, 2025
152f4f9
Return dataset lengths
aknierim Dec 17, 2025
8630c32
Fix paths in codecarbon config, create save directory
aknierim Dec 17, 2025
706f612
Replace carbontracker contextmanager function with class
aknierim Dec 17, 2025
80368e2
Update model_cli with new carbontracker
aknierim Dec 17, 2025
f646d50
Remove currently unused plotting functions
aknierim Dec 17, 2025
ee6221d
Fix peak ratio calculation
aknierim Dec 17, 2025
b3b3ba9
Check if input is tensor before using in analyse_intensity
aknierim Dec 17, 2025
d4ed643
Add more metrics, params for logging in mlflow
aknierim Dec 17, 2025
61fb811
Track task
aknierim Dec 17, 2025
5f8b904
Add temporary solution to get H5 dataset length
aknierim Dec 17, 2025
fd40e4f
Add shorthands for dataloaders
aknierim Dec 17, 2025
a62b3f3
Fix MaskedSplittedL1Loss
aknierim Dec 23, 2025
e12fcb5
Fix plotting paths for mlflow callback
aknierim Dec 23, 2025
b4604a2
Change artifact path for mlflow callbacks
aknierim Dec 29, 2025
a79d79f
Add compression handling for .tar.gz webdatasets
aknierim Dec 29, 2025
14faf89
Allow more strategies aside from deepspeed
aknierim Dec 29, 2025
b8b5975
Remove obsolete checkpoint_path_prefix kwarg from MLFlowLoggerConfig
aknierim Dec 29, 2025
165da31
Fix callbacks, add optimizer and scheduler to model param log
aknierim Dec 29, 2025
782d599
Update scheduling config
aknierim Dec 29, 2025
40603eb
Update train module to handle lr schedulers
aknierim Dec 29, 2025
c816c4c
Merge branch 'lightning' of github.com:radionets-project/radionets in…
aknierim Dec 29, 2025
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: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
jobs:
tests:
runs-on: ${{ matrix.os }}
if: contains(github.event.pull_request.labels.*.name, 'skip-ci') == false
strategy:
matrix:
include:
Expand Down Expand Up @@ -88,6 +89,7 @@ jobs:

docs:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'skip-ci') == false
steps:
- uses: actions/checkout@v5
with:
Expand Down
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,20 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies: [tomli]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.14.3"
hooks:
- id: ruff-format
- id: ruff-check
args: ["--fix", "--show-fixes"]

- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v1.0.0
hooks:
- id: sphinx-lint
4 changes: 2 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Maintenance

- Deleted unused functions

- Deleted unsued architectures
- Deleted unused architectures
- Renamed symmetry function [`#166 <https://github.com/radionets-project/radionets/pull/166>`__]

- Added radionets logo to README [`#169 <https://github.com/radionets-project/radionets/pull/169>`__]
Expand Down Expand Up @@ -220,7 +220,7 @@ Radionets 0.2.0 (2023-01-31)
API Changes
-----------

- Train on half-sized iamges and applying symmetry afterward is a backward incompatible change
- Train on half-sized images and applying symmetry afterward is a backward incompatible change
- Models trained with early versions of ``radionets`` are not supported anymore [`#140 <https://github.com/radionets-project/radionets/pull/140>`__]


Expand Down
84 changes: 84 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@

# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
102 changes: 68 additions & 34 deletions configs/radionets_default_train_config.toml
Original file line number Diff line number Diff line change
@@ -1,42 +1,76 @@
# This is a TOML document.

title = "Train configuration"

[mode]
quiet = true
gpu = false

[logging]
comet_ml = true
project_name = "VLA"
plot_n_epochs = 2
scale = true
title = "Radionets Default Training Configuration"

# ─────────────────────────────────────────────────────────────────────────────
# PATHS & I/O
# ─────────────────────────────────────────────────────────────────────────────
[paths]
data_path = "./example_data/"
model_path = "./build/example_model/example.model"
pre_model = "none"
checkpoint = false

[general]
# ─────────────────────────────────────────────────────────────────────────────
# MODEL & ARCHITECTURE
# ─────────────────────────────────────────────────────────────────────────────
[model]
arch_name = "SRResNet18"
fourier = true
amp_phase = true
normalize = false
source_list = false
arch_name = "filter_deep"
loss_func = "splitted_L1"
num_epochs = 5
inspection = true
output_format = "png"
switch_loss = false
when_switch = 25

[hypers]
batch_size = 100
lr = 1e-3

[param_scheduling]
use = true
lr_start = 7e-2
lr_max = 3e-1
lr_stop = 5e-2
lr_ratio = 0.25

# ─────────────────────────────────────────────────────────────────────────────
# TRAINING
# ─────────────────────────────────────────────────────────────────────────────
[training]
num_epochs = 50
batch_size = 16

[training.loss]
loss_func = "MSELoss"

[training.optimizer]
optimizer = "AdamW"
lr = 0.001

[training.lr_scheduling]
scheduler = "OneCycleLR"

# kwargs for OneCycleLR
# See: https://docs.pytorch.org/docs/stable/generated/torch.optim.lr_scheduler.OneCycleLR.html
max_lr = 1e-3 # Maxmimum at 1e-3
div_factor = 1e2 # Initial at 1e-3 / 1e2 = 1e-5
final_div_factor = 1e2 # Final at initial_lr / 1e2 = 1e-7
pct_start = 0.25

# ─────────────────────────────────────────────────────────────────────────────
# ACCELERATORS & DATALOADING
# ─────────────────────────────────────────────────────────────────────────────
[devices]
accelerator = "gpu"
num_devices = "auto"
precision = "32-true"
deepspeed = "deepspeed_stage_2"

[dataloader]
module = "WebDatasetModule"
num_workers = 10
prefetch_factor = 2
persistent_workers = false

# ─────────────────────────────────────────────────────────────────────────────
# CALLBACKS
# ─────────────────────────────────────────────────────────────────────────────
[callbacks.checkpoint]
every_n_epochs = 2
save_top_k = -1

[callbacks.batch_size_finder]
mode = "binsearch"

# ─────────────────────────────────────────────────────────────────────────────
# LOGGING
# ─────────────────────────────────────────────────────────────────────────────
[logging]
project_name = "Radionets Experiment"
plot_n_epochs = 1
scale = true
comet_ml = true
1 change: 0 additions & 1 deletion docs/changes/194.maintenance.2.rst

This file was deleted.

4 changes: 3 additions & 1 deletion docs/changes/194.maintenance.rst
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Added docstrings to classses of :mod:`radionets.core.callbacks`
Added docstrings to classes of :mod:`radionets.core.callbacks`

Fix plot sizes in classes of :mod:`radionets.core.callbacks`
2 changes: 1 addition & 1 deletion docs/developer-guide/contributions.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ use the imperative, a short description as the first line, followed by a blank l
and then followed by details if needed, e.g. as a bullet list.

```{seealso}
[Convetional Commits][conventionalcommits] for examples and information
[Conventional Commits][conventionalcommits] for examples and information
on how to write good commit messages.
```
Make sure you frequently test the code during development (see {ref}`testing`).
Expand Down
50 changes: 44 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ dev = [
]

[project.scripts]
radionets-simulation = "radionets.simulations.scripts.simulate_images:main"
radionets-training = "radionets.training.scripts.start_training:main"
radionets-evaluation = "radionets.evaluation.scripts.start_evaluation:main"
radionets-quickstart = "radionets.tools.quickstart:quickstart"
radionets = "radionets.tools.cli:main"

[tool.hatch.version]
source = "vcs"
Expand Down Expand Up @@ -133,7 +130,25 @@ omit = [
output = "coverage.xml"

[tool.pytest.ini_options]
addopts = "--verbose"
norecursedirs = [
".git",
".github",
"dist",
"build",
"docs",
]
addopts = [
"--strict-markers",
"--doctest-modules",
"--color=yes",
"--disable-pytest-warnings",
"--ignore=legacy/checkpoints",
]
filterwarnings = [
"error::FutureWarning",
"ignore:You are using `torch.load` with `weights_only=False`.*:FutureWarning",
]
xfail_strict = true

[tool.towncrier]
package = "radionets"
Expand Down Expand Up @@ -174,7 +189,7 @@ addopts = "--verbose"
[tool.ruff]
target-version = "py311"
line-length = 88
extend-exclude = ["tests", "examples"]
extend-exclude = ["examples"]

[tool.ruff.lint]
extend-select = [
Expand All @@ -192,6 +207,9 @@ unfixable = []

[tool.ruff.lint.per-file-ignores]
"examples/**" = ["I"]
"tests/**" = [
"E402",
]

[tool.ruff.format]
quote-style = "double"
Expand All @@ -202,3 +220,23 @@ docstring-code-format = true

[tool.ruff.lint.isort]
known-first-party = ["radionets"]

[tool.mypy]
files = [
"src/radionets",
]

install_types = "True"
non_interactive = "True"
disallow_untyped_defs = "True"
ignore_missing_imports = "True"
show_error_codes = "True"
warn_redundant_casts = "True"
warn_unused_configs = "True"
warn_unused_ignores = "True"
allow_redefinition = "True"
warn_no_return = "False"

[tool.codespell]
skip = "examples/**" # NOTE: For now we skip the examples
ignore-words-list = "RIME,bund"
2 changes: 1 addition & 1 deletion src/radionets/architecture/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
)
from .blocks import BottleneckResBlock, Decoder, Encoder, NNBlock, SRBlock
from .layers import LocallyConnected2d
from .unc_archs import Uncertainty, UncertaintyWrapper
from .uncertainty_archs import Uncertainty, UncertaintyWrapper

__all__ = [
"BottleneckResBlock",
Expand Down
14 changes: 7 additions & 7 deletions src/radionets/architecture/archs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import torch
from torch import nn

from radionets.architecture.activation import GeneralReLU
from radionets.architecture.blocks import ComplexSRBlock, SRBlock
from radionets.architecture.layers import (
from .activation import GeneralReLU
from .blocks import ComplexSRBlock, SRBlock
from .layers import (
ComplexConv2d,
ComplexInstanceNorm2d,
ComplexPReLU,
Expand Down Expand Up @@ -65,10 +65,10 @@ def __init__(self):
),
)

def _create_blocks(self, n_blocks):
def _create_blocks(self, n_blocks, **kwargs):
blocks = []
for _ in range(n_blocks):
blocks.append(SRBlock(64, 64))
blocks.append(SRBlock(64, 64, **kwargs))

self.blocks = nn.Sequential(*blocks)

Expand Down Expand Up @@ -118,10 +118,10 @@ def __init__(self):
),
)

def _create_blocks(self, n_blocks):
def _create_blocks(self, n_blocks, **kwargs):
blocks = []
for _ in range(n_blocks):
blocks.append(ComplexSRBlock(64, 64))
blocks.append(ComplexSRBlock(64, 64, **kwargs))

self.blocks = nn.Sequential(*blocks)

Expand Down
Loading
Loading