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
18 changes: 0 additions & 18 deletions .github/workflows/CompatHelper.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/Documenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
cp ./README.md ./docs/src/index.md

- name: "Install dependencies"
run: julia --project=docs/ -e 'using Pkg; Pkg.add(url="https://github.com/una-auxme/GraphNetCore.jl", rev="GNS-small-graph"); Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: "Build and deploy"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ deps/src/
# Build artifacts for creating documentation generated by the Documenter package
docs/build/
docs/site/
# Generated from README.md at build time (see docs/make.jl / Documenter.yml)
docs/src/index.md

# File generated by Pkg, the package manager, based on a corresponding Project.toml
# It records a fixed state of all packages used by the project. As such, it should not be
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2026 Josef Kircher <Josef.Kircher@uni-a.de> and contributors
Copyright (c) 2026 Josef Jouaux <Josef.Kircher@uni-a.de> and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
30 changes: 17 additions & 13 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GraphNetSim"
uuid = "5ff66f56-808c-48e7-ac84-dd29877231f8"
version = "0.1.0"
authors = ["JK <Josef.Kircher@uni-a.de", "JT <julian.trommer@informatik.uni-augsburg.de>"]
authors = ["Josef Jouaux <Josef.Kircher@uni-a.de>", "JT <julian.trommer@uni-a.de>"]

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand All @@ -12,12 +12,14 @@ ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
GPUCompiler = "61eb1bfa-7361-4325-ad38-22787b887f55"
GraphNetCore = "7809f980-de1b-4f9a-8451-85f041491431"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
LightXML = "9c8b4983-aa76-5018-a973-4c85ecc9e179"
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
LuxCUDA = "d0bbae9a-e099-4d5b-a835-1c6931763bda"
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
Expand All @@ -29,33 +31,34 @@ PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
ReadVTK = "dc215faf-f008-4882-a9f7-a79a826fadc3"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
SciMLSensitivity = "1ed8b502-d754-442c-8d5d-10ac956f44a1"
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
cuDNN = "02a925ec-e4fe-4b08-9a7e-0d78e3d38ccd"

[sources]
GraphNetCore = {rev = "GNS-small-graph", url = "https://github.com/una-auxme/GraphNetCore.jl"}

[compat]
Adapt = "4.3.0"
Aqua = "0.8"
CSV = "0.10.15"
CUDA = "5.5.2"
CUDA = "5.9.6"
GPUCompiler = "~1.9"
ChainRulesCore = "1.16.0 - 1"
ComponentArrays = "0.15"
DataFrames = "1.6"
DataInterpolations = "8.6.0"
Distributions = "0.25"
GraphNetCore = "0.3.1"
GraphNetCore = "0.4.2"
HDF5 = "0.17"
JLD2 = "0.4 - 0"
JLD2 = "0.6"
JSON = "0.21"
JuliaFormatter = "2.2.1"
JuliaFormatter = "~2.2"
KernelAbstractions = "0.9.39"
Lux = "1.4 - 1"
LightXML = "0.9"
Lux = "1.13 - 1"
LuxCUDA = "0.3"
MLUtils = "0.4.4 - 0.4"
Optimisers = "0.4, 1"
Expand All @@ -66,19 +69,20 @@ PreallocationTools = "0.4.34"
Printf = "1"
ProgressMeter = "1.7.0 - 1"
Random = "1"
ReadVTK = "0.2.6"
RecursiveArrayTools = "3.36.0"
SciMLBase = "2.7.0 - 2"
SciMLSensitivity = "7.76 - 7"
Setfield = "1.1.2"
Statistics = "1"
Test = "1"
Zygote = "0.6"
Zygote = "0.6, 0.7"
cuDNN = "1.4 - 1"
julia = "1.10"
julia = "1.11"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Aqua", "Statistics", "Test"]
test = ["Aqua", "Test"]
52 changes: 38 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# GraphNetSim.jl

<p align="center">
<img src="https://raw.githubusercontent.com/una-auxme/GraphNetSim.jl/main/docs/src/assets/logo.svg" alt="GraphNetSim.jl logo" width="200"/>
</p>

[![Docs](https://img.shields.io/badge/docs-dev-blue.svg)](https://una-auxme.github.io/GraphNetSim.jl/dev)
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/JuliaDiff/BlueStyle)
Expand All @@ -17,6 +21,13 @@

The package is build upon [**GraphNetCore.jl**](https://github.com/una-auxme/GraphNetCore.jl) for the underlying graph neural network architecture.

## Requirements

- **Julia ≥ 1.11**
- Built on [GraphNetCore.jl](https://github.com/una-auxme/GraphNetCore.jl) **v0.4**, which uses a
[Lux.jl](https://github.com/LuxDL/Lux.jl) `TrainState` and pulls in a CUDA-capable stack.
- A CUDA-capable GPU is recommended for training (falls back to CPU when CUDA is unavailable).

## Installation

To add GraphNetSim.jl to your Julia environment, use:
Expand Down Expand Up @@ -62,16 +73,18 @@ min_loss = train_network(
training_strategy=DerivativeTraining() # Training strategy
)

# Evaluate the trained network with long-term rollouts
# Evaluate the trained network with long-term rollouts.
# Note: the ODE solver is the 4th *positional* argument (not a keyword).
eval_network(
ds_path,
cp_path,
"./results"; # Output directory
solver=Tsit5(), # ODE solver
"./results", # Output directory
Tsit5(); # ODE solver (positional)
start=0.0f0,
stop=1.0f0,
saves=0.0:0.01:1.0, # Time points to save
mse_steps=0.0:0.1:1.0 # Time points for error metrics
dt=0.01f0, # fixed timestep (omit for adaptive stepping)
saves=0.0f0:0.01f0:1.0f0, # Time points to save
mse_steps=collect(0.0f0:0.1f0:1.0f0), # Time points for error metrics
)
```

Expand All @@ -93,7 +106,7 @@ The metadata file defines feature dimensions, node types, graph connectivity, an

## Key Features

- **Multiple Training Strategies**: Choose between `BatchingTraining` and `DerivativeTraining` to suit your problem
- **Multiple Training Strategies**: `DerivativeTraining` (fast, no ODE solve), plus the ODE-based `BatchingStrategy`, `SingleShooting`, and `MultipleShooting` for fine-tuning
- **GPU-accelerated Training**: Automatic CUDA detection and memory management
- **Flexible Architecture**: Configurable message passing steps, layer sizes, and hidden layers
- **Progress Monitoring**: Built-in progress bars and logging for training and validation
Expand Down Expand Up @@ -136,30 +149,41 @@ See the [full API documentation](https://una-auxme.github.io/GraphNetSim.jl/dev/

## Visualization

Export predicted trajectories as VTK files for visualization:
Export the evaluation results as VTK HDF files for visualization in ParaView. The
`eval_network` output is written under `<out_path>/<solver>/trajectories.h5`:

```julia
visualize(
"trajectories.h5", # Results file from eval_network
"./vtk_output", # Output directory
"pos", # Position dataset name
"prediction"; # Subgroup to visualize
Trajectorys=1:5 # Trajectory indices
visualize_eval(
"./results/tsit5/trajectories.h5", # trajectories.h5 written by eval_network
"./results/vtkhdf/", # output directory for the VTK HDF files
)
```

The lower-level `visualize` function is also available for exporting a single group of a
custom HDF5 file (see the [API reference](https://una-auxme.github.io/GraphNetSim.jl/dev/api/)).

## Related Packages

- [**PointNeighbors.jl**](https://github.com/una-auxme/PointNeighbors.jl): Efficient spatial indexing for neighbor queries
- [**Octopus.jl**](https://github.com/una-auxme/Octopus.jl): Fast octree neighborhood search on CPU and NVIDIA GPUs
- [**GraphNetCore.jl**](https://github.com/una-auxme/GraphNetCore.jl): Core GNN architecture and normalization strategies
- [**DifferentialEquations.jl**](https://github.com/SciML/DifferentialEquations.jl): ODE solvers for trajectory integration

## References

This package is inspired by the Graph Network-based Simulator (GNS) framework:

- Sanchez-Gonzalez, A., Godwin, J., Pfaff, T., et al. (2020). "Learning to Simulate Complex Physics with Graph Networks." *Proceedings of the 37th International Conference on Machine Learning (ICML)*.

## License and Attribution

GraphNetSim.jl is distributed under the [MIT License](https://github.com/una-auxme/GraphNetSim.jl/blob/main/LICENSE).

It includes / is derived from portions of DeepMind's
[`learning_to_simulate`](https://github.com/google-deepmind/deepmind-research/tree/master/learning_to_simulate)
(Copyright 2020 DeepMind Technologies Limited), which is licensed under the Apache License,
Version 2.0. The attribution and the full Apache 2.0 license text are provided in
[`THIRD_PARTY_NOTICES.md`](https://github.com/una-auxme/GraphNetSim.jl/blob/main/THIRD_PARTY_NOTICES.md).

## Contributing

We welcome contributions to GraphNetSim.jl! Please follow the [ColPrac](https://github.com/SciML/ColPrac) guidelines for collaborative practices.
Loading
Loading