lululxvi / deeponet

Learning nonlinear operators via DeepONet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dimension issue in generating operator "system.py".

phuongle0701 opened this issue · comments

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:

  • The space that I choose is Finite Power Series with N = 100 and M = 1
  • m: the number of sensors (So I get the sensors to be an array of m-by-1) Choose m = 50
  • m_u: the number of u's ( the sample u is an array of m_u-by-m) Choose m_u = 60
  • m_y: the number of y's ( an array of m_y-by-1) Choose m_y = 40

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.

commented

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.