-
Notifications
You must be signed in to change notification settings - Fork 0
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
Training and Inference on sub-domains #7
base: tibo
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @chelseajohn, thanks for the PR. There is many things that are not very clear, sometime confusing, that need to be properly defined. In particular, this parameters mixing between input patches and subdomain output. I believe this can be made much more simpler, which would avoid a lot of confusion later on.
This PR contains code to perform sampling along with training and evaluation using patches(sub-domain) of samples.
Training
Training on sub-domains is enabled by the arguments in
config.data
With a combination of the above parameters the following sampling can be done:
nPatch_per_sample
random sized patches (sX,sY) randomly sampled from (nX,nY) grid (can contain overlapping patches)nPatch_per_sample
fixed sized patch of (sX,sY) randomly sampled from (nX,nY) grid (can contain overlapping patches)To sample fixed sized patch of (sX,sY) without overlapping from (nX,nY) grid
nPatch_per_sample
will be overwritten to(nX//sX)*(nY//sY)
.Use
padding
argument the inflow/outflow of patch can be set.Use
use_minLimit: true
to restrict (sX,sY) to be > (2 * (kX-1), 2 * (kY-1)), it must be set toTrue
whenpad_to_fullGrid
isFalse
Use
use_fixedPatch_startIdx
to sampleslices
for every epoch from the same indexUse
pad_to_fullGrid
to embed patches (sX,sY) into a (nX,nY) grid of zeroesAdditionally, to make training runs reproducible
slices
andpatch_startIdx
can be passedInference
To perform evaluation such that FNO predicts patches of the input grid , the model filters out the output patch before passing it into the
Q
projection layer. It can be enabled using the following arguments inconfig.model
Keep in mind that the slice size
i{X,Y}End - i{X,Y}Beg
has to be >2*(fourier_modes -1)
.Contour Plotting
11_modelOutput.py
has been modified to allow evaluation and plotting contours for :--use_full_input
)--use_full_input --get_subdomain_output
+ above mentionedconfig.model
args)--iXBeg, --iXEnd, --iYBeg, --iYEnd
)