(self, npoints=30, ncycles=3, divide=0.2, amplitude=1, curvetype='Lissajous1')
curvetype (str, optional): 'Lissajous1' or 'Lissajous2'
curvetype (str, optional): 'Lissajous1' or 'Lissajous2'
curvetype ( str optional ) : Lissajous1 or Lissajous2
def __init__(self, npoints=30, ncycles=3, divide=0.2, amplitude=1, curvetype='Lissajous1'):
        """
        curvetype (str, optional): 'Lissajous1' or 'Lissajous2'
        """
        self.nsamples = npoints * ncycles
        self.x = np.linspace(0, ncycles * 2 * math.pi, self.nsamples)

        if curvetype not in ('Lissajous1', 'Lissajous2'):
            raise NotImplementedError()

        sin_scale = 2 if curvetype == 'Lissajous1' else 1

        def y_x(x):
            return 4.0 / 5 * math.sin(x / sin_scale)

        def y_y(x):
            return 4.0 / 5 * math.cos(x / 2)

        self.data = np.zeros((self.nsamples, 2))
        self.data[:, 0] = np.asarray([y_x(xs)
                                      for xs in self.x]).astype(np.float32)
        self.data[:, 1] = np.asarray([y_y(xs)
                                      for xs in self.x]).astype(np.float32)

        L = len(self.data)
        c = int(L * (1 - divide))
        self.train = self.data[:c]
        self.test = self.data[c:]
def __init__ ( self , npoints = 30 , ncycles = 3 , divide = 0.2 , amplitude = 1 , curvetype = 'Lissajous1' ) : self . nsamples = npoints * ncycles self . x = np . linspace ( 0 , ncycles * 2 * math . pi , self . nsamples ) if curvetype not in ( 'Lissajous1' , 'Lissajous2' ) : raise NotImplementedError ( ) sin_scale = 2 if curvetype == 'Lissajous1' else 1 def y_x ( x ) : return 4.0 / 5 * math . sin ( x / sin_scale ) def y_y ( x ) : return 4.0 / 5 * math . cos ( x / 2 ) self . data = np . zeros ( ( self . nsamples , 2 ) ) self . data [ : , 0 ] = np . asarray ( [ y_x ( xs ) for xs in self . x ] ) . astype ( np . float32 ) self . data [ : , 1 ] = np . asarray ( [ y_y ( xs ) for xs in self . x ] ) . astype ( np . float32 ) L = len ( self . data ) c = int ( L * ( 1 - divide ) ) self . train = self . data [ : c ] self . test = self . data [ c : ]