- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 7
Fourier Layer Tests #35
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
base: master
Are you sure you want to change the base?
Conversation
| For the training test, let's start with regression testing. The tutorial has examples using them to solve some equations. Do that on a PDE with a known analytical solution and do a difference against the analytical solution, putting the tolerance just above the error of what you get locally. That would then trigger if the training ever gets worse. Usually taking the current loss and multiplying it by like 3 or 5 is a safe regression value. | 
| Would we need a dataset in the library for that? | 
| Maybe we can add a smaller version of the Burgers' equation dataset which contains just what we need for the test, because the whole data file is like 600MB | 
| It has data for 2048 initial conditions at 8192 points for each😅. We can use like 100 - 200 ICs at 1024 points(just like the tutorial), would that work? | 
| So I tried implementing a training test for fourier layer, I think there could be a bug here, I have followed the burgers' equation example here Error: ... Both xtrain and grid are Float64 here. When I make them Float32 explicitly this error resolves and the model trains normally. I did the same to avoid it here | 
| The test for DeepONet works fine | 
| Then split out the DeepONet tests so those can merge quicker while the other ones are investigated. | 
| Codecov Report
 @@             Coverage Diff             @@
##           master      #35       +/-   ##
===========================================
+ Coverage   41.09%   57.53%   +16.43%     
===========================================
  Files           6        6               
  Lines          73       73               
===========================================
+ Hits           30       42       +12     
+ Misses         43       31       -12     
 Continue to review full report at Codecov. 
 | 
| Yeah, somehow FourierLayer doesn't promote its parameters data type to match the inputs although it should. I haven't found the culprit for sure but the no. 1 suspects are the tensor multiplications: OperatorLearning.jl/src/FourierLayer.jl Line 107 in 9b16e02 
 OperatorLearning.jl/src/FourierLayer.jl Line 115 in 9b16e02 
 I'm working on switching those implementations out for more specialized code anyways in #31, but the problem might well be elsewhere - that's just my best guess so far. | 
| There's one last thing, for reading the data from .mat file would we need MAT.jl as one of the dependencies. Do I run  | 
| 
 Yep. However, I wouldn't include  | 
I have added a couple of simple tests for Fourier Layer and DeepONet Layer. What more tests can we add for the same?
One thing that I wanted to add for test/deeponet.jl
but the problem is, making the parameters same for model1 and model2 doesn't seem feasible here. Besides, I wanted to know how to formulate a test for training of FNO and DeepONet?