No result when using 'PointwiseConstraint.from_numpy' for 1D problem

I have loaded my 1D data using the following lines:
def read_eta_data(time, Nx):
eta_filename = to_absolute_path(f"data_ppt1D512/eta.{int(time):03d}.npz")
data= np.load(eta_filename)[“arr_0”].astype(np.float32)
x = np.expand_dims(np.linspace(0, Nx, 512), axis=-1)
invar={}
invar[“x”]=x
invar[“t”] = np.full_like(invar[“x”], time * 0.005)
outvar = {}
outvar[“eta”]=np.expand_dims(data, axis=-1)
return invar, outvar

And I used the above data for initial timestep constraint,
for i, ms in enumerate(np.linspace(101, 200, 10)):
timestep_invar, timestep_outvar = read_eta_data(ms, Nx)
timestep = PointwiseConstraint.from_numpy(
nodes,
timestep_invar,
timestep_outvar,
batch_size,
)
domain.add_constraint(timestep, f"BC{i:03d}")

But when I run my code, it doesn’t move forward and doesn’t show any error message as well. This is what is shown in log file.
[05:22:37] - Jit compiling network arch
[05:22:37] - Jit compiling network arch
[05:22:39] - attempting to restore from: outputs/PF1D_data_512
[05:22:39] - optimizer checkpoint not found
[05:22:39] - model c_network.pth not found
[05:22:39] - model eta_network.pth not found

Can someone let me know what is the issue?

Hi @gaijinliugangmei

Well no errors probably means that you are setting up your constraints correctly (hopefully!). Could you potentially be adding a large number of training points?

For example, this bit is creating 10 different contraints:

for i, ms in enumerate(np.linspace(101, 200, 10)):
timestep_invar, timestep_outvar = read_eta_data(ms, Nx)
timestep = PointwiseConstraint.from_numpy(
nodes,
timestep_invar,
timestep_outvar,
batch_size,
)
domain.add_constraint(timestep, f"BC{i:03d}")

What hardware are you running on? I would try reducing the number of constraints and/or training points to see if it get through a few iterations.

Thank you for your suggestion. It is working now.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.