In the file robertson_pinn/robertson_pinn.py, there is a code snippet:
|
if use_annealing == False: |
|
scaling_fac = 1e-7 |
|
I1 = torch.Tensor([1,0,0]).to(device=device) * scaling_fac |
|
I2 = torch.Tensor([0,1e-9,0]).to(device=device) * scaling_fac |
|
I3 = torch.Tensor([0,0,1e5]).to(device=device) * scaling_fac |
Moving to :
|
if use_annealing == False: |
|
|
|
loss_res_train = I1 * criterion(dydt_train[:,0] * w_res[0], rhs_train[:,0] * w_res[0]) \ |
|
+ I2 * criterion(dydt_train[:,1] * w_res[1], \ |
|
rhs_train[:,1] * w_res[1]) + \ |
|
I3 * criterion(dydt_train[:,2] * w_res[2], \ |
|
rhs_train[:,2] * w_res[2]) |
|
|
|
loss_res_test = I1 * criterion(dydt_test[:,0] * w_res[0], rhs_test[:,0] * w_res[0]) \ |
|
+ I2 * criterion(dydt_test[:,1] * w_res[1], \ |
|
rhs_test[:,1] * w_res[1]) + \ |
|
I3 * criterion(dydt_test[:,2] * w_res[2], \ |
|
rhs_test[:,2] * w_res[2]) |
It can be seen that two sets of weights have been used, for example, I1 * criterion(dydt_train[:,0] * w_res[0], rhs_train[:,0] * w_res[0]) for the first species. Can you please explain why two separate sets of weights(I and wres) have been used?
In the file
robertson_pinn/robertson_pinn.py, there is a code snippet:Stiff-PINN/robertson_pinn/robertson_pinn.py
Lines 128 to 132 in ec41e5e
Moving to :
Stiff-PINN/robertson_pinn/robertson_pinn.py
Lines 179 to 191 in ec41e5e
It can be seen that two sets of weights have been used, for example,
I1 * criterion(dydt_train[:,0] * w_res[0], rhs_train[:,0] * w_res[0])for the first species. Can you please explain why two separate sets of weights(I and wres) have been used?