lululxvi / deeponet

Learning nonlinear operators via DeepONet
Other
509 stars 139 forks source link

Dimension issue in generating operator "system.py". #5

Closed phuongle0701 closed 2 years ago

phuongle0701 commented 3 years ago

Hi, First of all, thank you very much for your excellent work.

I tried to test the dimension-match in system.py for the case of simple linear ODE with the following parameters:

However, I get the dimension for s which value of G(u)(y) is an array of 40-by-1. Should this value have to be an array of (m_u * m_y)-by-1 which is in this case 2400-by-1?

This is my modified part:

def gen_operator_data(self,space,m, m_u, m_y):
        print("GENERATING THE DATA...", flush = True)           
        features= space.random(m_u) # build the features (m_u, N) check
        sensors = np.linspace(0, self.T, m)[:, None] # build the sensors (m,1) check 
        u = space.eval_u(features_train, sensors) # get the sample u's (m_u, m) check
        x  = self.T * np.random.rand(m_y)[:,None] # get the sample y's (m_y, 1) check
        s = self.eval_op_space(space, features, x) # get the values s'  
        Xdata = [u, x] 
        Ydata = s
        return Xdata, Ydata

I look forward to hearing from you soon.

Best Regards.

lululxvi commented 3 years ago

In this case, we don't do the Cartesian produce of u and y. For each u, we only know the solution G(u)(y) for one y. So, if you have 60 u, you need also to have 60 y. For the first u, you know the solution G(u)(y) ONLY on the first y, etc. Note that each data point is a triple, as discussed in page 5 "Data generation." paragraph, and also SI S3, and Table S2.

Of course, you can allow that for each u, we know the solution G(u)(y) for multiple y. To do this, you can repeat the same u for multiple times.