deepxde icon indicating copy to clipboard operation
deepxde copied to clipboard

how to get the 'variables' of new predictions using the trained model

Open DonnaShin opened this issue 2 years ago • 4 comments

Hello, LuLu

I read your paper and tried your code for apoptosis. During training, I was able to get the 'variables' of the ode model well. However, I would like to know how to get the 'variables' of new predictions using the trained model. I couldn't find it in the deepxde FAQ.

DonnaShin avatar Apr 14 '22 10:04 DonnaShin

I don't get your question.

lululxvi avatar Apr 17 '22 20:04 lululxvi

I don't get your question.

Oh....I'm sorry for asking a question without a detailed explanation. The 'variable' I was talking about was a parameter of the ode system and meant a trainable variable (in Lorenz system C1, C2, C3 ). In the inverse problem, I could verify the ode parameter ('C1, C2, C3') through callback during training. However, what I want is a way to get the ode parameters (like 'C1, C2, C3') of a new prediction using an already trained model. Please let me know if this is possible and, if so, how to do it.

https://deepxde.readthedocs.io/en/latest/demos/pinn_inverse/lorenz.inverse.html

DonnaShin avatar Apr 19 '22 01:04 DonnaShin

Hello @DonnaShin , please can share your code with me ? I have a first order nonlinear ODE and I want to infer one parameter A and I tried with many different hyperparameters and still the results are unstable and wrong and I am stuck now. I used the Lorenz inverse problem as the basis of the code. def Emsley_system(t, DP):

k=A*(tf.math.exp(-E / (R * (T+273))))

dy_x = dde.grad.jacobian(DP, t, i=0)

return [

dy_x + k * (DP**2),

] and I am trying the infer the value of A. The true value of A is 7.8*(10**8) and the time domain according to the data that I have is between 1 and 2000 days and DP value range from 1000 to 200 , I tried to include 10^8 in the expression of the ODE and use the log(A) instead of A and scale the time domain between 0 and 5 but still I have MSE in the range of 10^4 and wrong A value.

khaoulaoue avatar Apr 21 '22 07:04 khaoulaoue

At this moment, there is no existing API for this. But you can look at the source code of dde.callbacks.VariableValue, and you can find the code there.

lululxvi avatar Apr 22 '22 01:04 lululxvi

At this moment, there is no existing API for this. But you can look at the source code of dde.callbacks.VariableValue, and you can find the code there.

Understood. Thank you for providing a good library.

DonnaShin avatar Apr 25 '22 02:04 DonnaShin