Comments (3)
The initial conditions are hidden in the first loss
. You can reduce the number of points there to
x_data = x[0:2]
y_data = y[0:2]
and the code still works.
I wrote (with my student) a version of this code reducing the 2nd order ODE into two 1st order ODEs, then it gets clear where the initial conditions enter. In your code the data is simply the initial position and velocity at t=0.
Regarding loos2, indeed the 1e-4 factor is weird and I was also checking that. I use:
physics = (dx2 + mu*dx + k*yhp) / k
loss2 = torch.mean(physics**2)
Dividing physics
by k helps because the loss1 and loss2 error are now written in the same units. The 1e-4 term seems to be an implicit workaround to fix the units.
I'll put my code on gitlab soon.
from harmonic-oscillator-pinn.
Thanks, your explanation was great!
Looking forward to your code!
from harmonic-oscillator-pinn.
Thanks. My version is nearly identical to the one here. The only differences are: (i) this normalization of the loss to fix the units/dimensions; (ii) a second version in terms of two 1st order ODEs (reduction of order); (iii) many comments on each step to make it as pedagogical as possible (since this is a project for students entering this research field).
My version is ready, but I want my student to develop her version on her own. So, I'll only upload to gitlab once she finishes her version. It may take a while (couple of weeks maybe), she is still at the beginning of the project.
from harmonic-oscillator-pinn.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from harmonic-oscillator-pinn.