title: Regression: How can I approximate a multi-dimensional function?
body: <p>I want to approximate a <code>sinc</code> function using neural networks. This is my code:</p>
  
  <pre><code>import tensorflow as tf
  from keras.layers import Dense
  from keras.models import Sequential
  
  
  N = 10000
  
  x1 = numpy.empty((N,))
  x2 = numpy.empty((N,))
  x3 = numpy.empty((N,))
  z1 = numpy.empty((N,))
  z2 = numpy.empty((N,))
  y = numpy.empty((N,))
  
  
  for i in range(N):
      x1[i] = random.uniform(-10, 10)
      x2[i] = random.uniform(-10, 10)
      x3[i] = random.uniform(-10, 10)
  
  z1 = x1 + x2 - x3
  z2 = -x1 + x2 + x3
  
  for i in range(N):
      y[i] = (numpy.sin(z1[i])/z1[i])*(numpy.sin(z2[i])/z2[i])
  
  y = y.reshape(-1, 1)
  
  scaler = MinMaxScaler()
  
  x1 = scalar.fit_transform(x1)
  x2 = scalar.fit_transform(x2)
  x3 = scalar.fit_transform(x3)
  
  y = scalar.fit_transform(y)
  
  model = Sequential()
  model.add(Dense(50, activation='relu', input_shape=(3,)))
  model.add(Dense(1, activation='relu'))
  
  model.fit(X, y, epochs=50, verbose=1, batch_size=2)
  </code></pre>
  
  <p>I have seen similar codes where <code>X</code> and <code>Y</code> are two one-dimensional matrixes, but in my case, I should calculate <code>y</code> using three input values. What is <code>X</code> in the code above for my case? In other words, how should I create <code>X</code> using <code>x1</code>, <code>x2</code> and <code>x3</code>?</p>