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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ dist
.benchmarks
benchmark_*.pdf
examples/.data_dir
examples/.data_dir_b
17 changes: 16 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_,
and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.

[0.3.7] - 2026-01-25
--------------------

**Changed**

- Convolve and DyConvolve can take a scalar argument for scales, and will return transformed signal instead of list in that case.
- Convolve and DyConvolve can also take a 1D signal and will return a transformed 1D signal in that case
- impulse function now 1D by default
- Misc examples updated to show this feature
- Broke up benchmark into four seperatea performance tests

**Added**

- Improved Chebyshev approximator

[0.3.6] - 2026-01-18
--------------------

Expand Down Expand Up @@ -83,4 +98,4 @@ and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0
**Added**

- First stable public release of the ``sgwt`` package.
- Comprehensive documentation, usage examples, and testing suite.
- Comprehensive documentation, usage examples, and testing suite.
Binary file added docs/_static/images/demo_benchmark_a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/images/demo_benchmark_b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/images/demo_benchmark_c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/images/demo_benchmark_d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/images/demo_cheby_coeffs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/images/demo_cheby_convolve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/_static/images/demo_cheby_convolve_2.png
Binary file not shown.
Binary file modified docs/_static/images/demo_cheby_time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/images/demo_mesh_wavelet_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion docs/examples/benchmarks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ This section contains performance benchmarks and comparisons for the analytical
:maxdepth: 1
:caption: Analytical Filter Performance

benchmarks/demo_benchmark
benchmarks/demo_benchmark_a
benchmarks/demo_benchmark_b
benchmarks/demo_benchmark_c
benchmarks/demo_benchmark_d

.. toctree::
:maxdepth: 1
Expand Down
15 changes: 0 additions & 15 deletions docs/examples/benchmarks/demo_benchmark.rst

This file was deleted.

9 changes: 9 additions & 0 deletions docs/examples/benchmarks/demo_benchmark_a.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Benchmark: Graph Size Scaling
=============================

This benchmark shows how execution time scales with graph size (number of edges) for both ``Convolve`` (Static) and ``DyConvolve`` (Dynamic) solvers across lowpass, bandpass, and highpass filters.

.. image:: /_static/images/demo_benchmark_a.png
:alt: Graph Size Scaling Benchmark
:align: center
:width: 80%
9 changes: 9 additions & 0 deletions docs/examples/benchmarks/demo_benchmark_b.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Benchmark: Signal Count Scaling
===============================

This benchmark shows how execution time scales with the number of input signals (M) for the analytical graph wavelet solvers.

.. image:: /_static/images/demo_benchmark_b.png
:alt: Signal Count Scaling Benchmark
:align: center
:width: 80%
9 changes: 9 additions & 0 deletions docs/examples/benchmarks/demo_benchmark_c.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Benchmark: Scale Count Scaling
==============================

This benchmark shows how execution time scales with the number of wavelet scales (J) for the analytical graph wavelet solvers.

.. image:: /_static/images/demo_benchmark_c.png
:alt: Scale Count Scaling Benchmark
:align: center
:width: 80%
9 changes: 9 additions & 0 deletions docs/examples/benchmarks/demo_benchmark_d.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Benchmark: Filter Order Scaling
===============================

This benchmark shows how bandpass filter order (K) affects execution time for the analytical graph wavelet solvers.

.. image:: /_static/images/demo_benchmark_d.png
:alt: Filter Order Scaling Benchmark
:align: center
:width: 80%
27 changes: 17 additions & 10 deletions docs/usage/input_signals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,34 @@ The primary input for all filtering operations is a signal defined on the vertic
Format and Memory Layout
------------------------

The signal array ``X`` should have the shape ``(n_vertices, n_timesteps)``, where:
The signal array ``X`` can be either:

- ``n_vertices`` is the number of vertices (nodes) in the graph, matching ``L.shape[0]``.
- ``n_timesteps`` is the number of independent signals or time samples to be processed concurrently.
- **1D**: Shape ``(n_vertices,)`` for a single signal
- **2D**: Shape ``(n_vertices, n_timesteps)`` for multiple signals

For optimal performance, it is highly recommended to create the signal array with **column-major (Fortran) ordering** by specifying ``order='F'``. This memory layout aligns with the underlying C-based ``CHOLMOD`` library, avoiding costly data re-ordering during computation.
where ``n_vertices`` is the number of vertices (nodes) in the graph, matching ``L.shape[0]``, and ``n_timesteps`` is the number of independent signals or time samples to be processed concurrently.

When a 1D signal is passed, the output will also be 1D (squeezed accordingly).

For optimal performance with 2D signals, it is highly recommended to create the signal array with **column-major (Fortran) ordering** by specifying ``order='F'``. This memory layout aligns with the underlying C-based ``CHOLMOD`` library, avoiding costly data re-ordering during computation.

.. code-block:: python

import numpy as np
from sgwt import DELAY_USA as L

n_vertices = L.shape[0]
n_signals = 10

# Create a random signal with the required ordering
X = np.random.randn(n_vertices, n_signals).astype(np.float64)
X = np.asfortranarray(X)
# 1D signal (single signal)
X_1d = np.random.randn(n_vertices)

# 2D signal (multiple signals)
n_signals = 10
X_2d = np.random.randn(n_vertices, n_signals).astype(np.float64)
X_2d = np.asfortranarray(X_2d)

# Verify the memory order
assert X.flags['F_CONTIGUOUS']
# Verify the memory order for 2D
assert X_2d.flags['F_CONTIGUOUS']

.. seealso::
:doc:`../theory/theory_graph`
Expand Down
1 change: 1 addition & 0 deletions docs/usage/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ What's Happening in This Example?

2. **Define Filter Parameters**
- ``scales = [0.1, 1.0, 10.0]``: We specify the scales for our band-pass filter. In spectral graph filtering, the scale is inversely related to frequency. Smaller scales target high-frequency components (details, sharp changes), while larger scales target low-frequency components (smooth variations).
- You can also pass a single scalar value (e.g., ``scales=1.0``), in which case the output will be a single array instead of a list.

3. **Perform the Convolution**
- ``with Convolve(L) as conv:``: This is the core of the library. We create a :class:`~sgwt.Convolve` context. Upon entry, it performs an efficient one-time symbolic factorization of the graph Laplacian ``L``. This pre-computation makes all subsequent filtering operations extremely fast. The context also manages all the low-level memory required by the CHOLMOD backend.
Expand Down
Loading