Skip to content

Adding supporting code for blog post #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mmarkows17
Copy link
Collaborator

Supporting code for the blog post Physics-Informed Machine Learning: Methods and Implementation

Comment on lines +1 to +14
function layer = fourierLayer(tWidth,numModes,args)

arguments
tWidth
numModes
args.Name = ""
end
name = args.Name;

net = dlnetwork;

layers = [
identityLayer(Name="in")
spectralConvolution1dLayer(tWidth,numModes,Name="specConv")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer the arguments here to be the other way around, fourierLayer(numModes, tWidth) and spectralConvolution1dLayer(numModes, tWidth). I think that has a better analogy to convolution1dLayer(filterSize, numFilters).

The numFilters and tWidth are analogous in that they control some hidden size of some linear operation with the weights. The numModes and filterSize are analogous in that they control the size/resolution of the convolution filter in some sense, and both can have N entries for an N-d conv or spectral conv.

@@ -0,0 +1,97 @@
classdef spectralConvolution1dLayer < nnet.layer.Layer ...
Copy link
Collaborator

@bwdGitHub bwdGitHub Jun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expect we could use the same version here and in the 1d FNO example - maybe we should consider a directory of shared tools for the examples.

That's something we'll have to look into in future I think, not something to try deal with in this PR.

@@ -0,0 +1,32 @@
# Physics Informed Machine Learning Methods and Implementation supporting code
This repository provides examples demonstrating a variety of Physics-Informed Machine Learning (PhiML) techniques, applied to a simple pendulum system. The examples provided here are discussed in detail in the accompanying blog post "Physics-Informed Machine Learning: Methods and Implementation".
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not "repository" here since this is being added as part of the wider examples repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants