Self-supervised¶
This guide shows how to train a neural operator on sine functions
in a self-supervised manner using the SelfSupervisedOperatorDataset
.
Setup¶
Dataset¶
Create a data set of sine waves: The SineBenchmark
generates \(N\) sine waves
$$
f(x) = \sin(w_k x), \quad w_k = 1 + \frac{k}{N-1},
$$
$$
\quad k = 0, \dots, N-1.
$$
We wrap the dataset by a SelfSupervisedDataset
that exports samples
for self-supervised training, namely
$$
\left(\mathbf{x}, f(\mathbf{x}), x_j, f(x_j)\right), \quad \text{for } j = 1, \dots, M,
$$
where \(\mathbf{x} = (x_i)_{i=1 \dots M}\) are the \(M\) equidistantly
distributed sensor positions.
This dataset contains 128 samples. Let's plot a random one!
Operator¶
In this example, we use a NaiveIntegralKernel
as neural operator with a
NeuralNetworkKernel
as kernel function.
Training¶
Train the neural operator.
Plotting¶
Plot model predictions for training data.
Generalization¶
Plot prediction on a test sample which was not part of the training set.
Created: 2024-08-20