FuncNets: Exploring artificial neural networks for mathematical function evaluation.
Author
Rahul Sharma
Title
FuncNets: Exploring artificial neural networks for mathematical function evaluation.
Description
In this project, given known values of mathematical functions, find ANNs that efficiently reproduce the values of the functions and compare their performance with Builtin-Methods and see how the Neural Nets perform on that data.
Category
Essays, Posts & Presentations
Keywords
Machine Learning, Neural Networks, FuncNets
URL
http://www.notebookarchive.org/2021-07-60wnutv/
DOI
https://notebookarchive.org/2021-07-60wnutv
Date Added
2021-07-13
Date Last Modified
2021-07-13
File Size
3.39 megabytes
Supplements
Rights
Redistribution rights reserved



WOLFRAM SUMMER SCHOOL 2021
FuncNets: Exploring artificial neural networks for mathematical function evaluation.
FuncNets: Exploring artificial neural networks for mathematical function evaluation.
Rahul Sharma
Undergraduate student IISERB
“Some Mathematical functions are evaluated using power series or rational approximations and whose coefficients are found by some mathematical procedure.
In this project, given known values of mathematical functions, find ANNs that efficiently reproduce the values of the functions and compare their performance with Builtin-Methods and see how the Neural Nets perform on that data.”
In this project, given known values of mathematical functions, find ANNs that efficiently reproduce the values of the functions and compare their performance with Builtin-Methods and see how the Neural Nets perform on that data.”
BesselJ/First Build
BesselJ/First Build
Introduction/Starting Code
Introduction/Starting Code
Results
Results
Angular Part of wavefunction of hydrogen atom:
Angular Part of wavefunction of hydrogen atom:
The solution of the wavefunction of the electron in a single electron hydrogen atom is given by:
phi[n_,l_,m_]=***LaguerreLn-l-1,2l+1,SphericalHarmonicY[l,m,θ,ϕ]a=52.9*
3
2
n a
(n-l-1)!
2n*
3
((n+l)!)
-r
n a
l
2r
n a
2r
n a
-12
10
Where n,l, and m are the quantum numbers.
a is Bohr radius.
r,θ,ϕ are the spherical coordinates
Approximating the whole function would have been difficult, so as any derivation of this equation is done, we will do both parts separately.
a is Bohr radius.
r,θ,ϕ are the spherical coordinates
Approximating the whole function would have been difficult, so as any derivation of this equation is done, we will do both parts separately.
Introduction / General Remarks
Introduction / General Remarks
Results/Graphs :
Results/Graphs :
Radial Part
Radial Part
◼
The basic process for finding the NN approximations for the Radial Part is same as the previous two.
◼
The model was trained on ,it gives us the probability densityThe code used is:
2
R
n,l
2
r
◼
It is observed that the basic Net structure of {LinearLayer,(Ramp(Also known as ,Tanh,Output} was enough. We needed to change the size/no of perceptrons of the number layers and tinker with learning rates/Optimizers. I hypothesize that since the functions(including) are smooth curves, the same kind of model did work for all of these functions. We just needed to increase the size of the layers as function complexity increased. Models were also made by adding more layers; some work for better, some worse, some start overfitting, or have marginal changes. More exploration is required.
Relu),LinearLayer)
n
Results/Graphs
Results/Graphs
FuncNets for complex functions:
FuncNets for complex functions:
I could not finish an extensive analysis as I would have liked to, given the two week time limits
The function I chose to train upon is, as it gave both
The function I chose to train upon is, as it gave both
f[z_]=5-4
2
z
z
First I tried to train on a 10 x 10 domain for {x+ y}, but small increment in x and y would make huge changes in the output of the function. So we needed a huge dataset, well that could not be done due to computational resource limitations.
Then i tried to cheat around it and try to train the model on a unit circle in the Complex Plane, by using the following code
Then i tried to cheat around it and try to train the model on a unit circle in the Complex Plane, by using the following code
data= Table[{x} ->{N[ f[]]//Re,N[ f[]]//Im}, {x, 0, 2π, 0.0005π}]val= RandomChoicedata,Round;data=Complement[data,val];data//Lengthval//Length
x
x
Length[data]
10
This would map x to the circle in Complex Plane, but I have tried most structures of NNs I could think of(its not exhaustive , of course ,I had time limitations, but tried many things). I could not reliably produce a good approximation.
So, in our next attempt I made the input vector as 2-D and generated the data as:
data= Table[{x,y} ->{N[ f[x+ y]]//Re,N[ f[x + y]]//Im}, {x, 0,1, 0.001},{y, 0,1, 0.001}]//Flattenval= RandomChoicedata,Round;data=Complement[data,val];data//Lengthval//Length
Length[data]
10
Then I did train a few models manually this time, cause each took about an hour, because our training data points needed to be close to a million for even 1x1 grid.
net2=NetTrain[NetChain[{512,Ramp,512,Tanh,512,2}],data,All,MaxTrainingRounds->400,TargetDevice"GPU",BatchSize256,LearningRate5*,Method{"SignSGD","LearningRateSchedule"schedule},ValidationSetval]
-4
10
It gave the following model as result, and the predicted values look very close to actual values, but further detailed analysis is incomplete, when I do pursue it further.I will make sure to update the post.
NetTrainResultsObject
NetTrain Results | ||||||||||||||||||
|
Concluding remarks
Concluding remarks
Thank You so much for reading. If you have any ideas/suggestions/comments. Or you would like to discuss more, feel free to let me know. I will be more than happy to do that.
Future plans/Ideas
Future plans/Ideas
Keywords
Keywords
Acknowledgment
Acknowledgment
References
References


Cite this as: Rahul Sharma, "FuncNets: Exploring artificial neural networks for mathematical function evaluation." from the Notebook Archive (2021), https://notebookarchive.org/2021-07-60wnutv

Download

