code: def dataset_bianchini(batchsize, k=1):
      """
      Synthetic data set where we can control Betti numbers from Bianchini et al. 2014.
      Input: 2D real values, Output: binary {0,1}.
      f = g(t_k(x)), where g=1-||x||^2, t_1(x)=[1-2*x_1^2, 1-2*x_2^2], t_k = t * t_{k-1}
      """
      g = lambda x: 1.0 - np.linalg.norm(x, ord=2) ** 2
      t = lambda x: 1.0 - 2.0 * (x**2)
  
      def f(x):
          for i in range(k):
              x = t(x)
          return g(x)
  
      while True:
          X = np.random.uniform(low=-1.0, high=1.0, size=(batchsize, 2))
          Y = (np.apply_along_axis(f, axis=1, arr=X) > 0.0).astype(
              "float32"
          )
          yield {"input": X}, {"output": Y}
  
file_path: sherpa/examples/parallel-examples/bianchini/bianchini.py
imports: from __future__ import print_function
  import numpy
  import sherpa
  from keras.models import Model
  from keras.layers import Dense, Input
  from keras.optimizers import SGD
label_desc: Use image node_id 1 for calling a global function with example usage: dataset_bianchini(batchsize, k) and returns: g