
import numpy as np

class Dataset():
    def __init__(self, data, target, classes):
        self.data = data
        self.target = target
        self.n_classes = classes

def count(items, T=8, classes=5):
    # Create initial value
    X = np.random.uniform(0, classes, size=(items, 1))

    # Create targe by incrementing
    inc = np.tile(np.arange(0, T), (items, 1))
    t = np.mod(X + inc, classes)
    t = np.floor(t)

    # add <EOS>
    t = t + 1
    t = np.hstack([t, np.zeros((items, 1))])

    return Dataset(
        (X / classes).astype('float32'),
        t.astype('int32'),
        classes + 1
    )

@@ -609,8 +609,694 @@
 1%0A    )%0A
+%0Adef floor(items, classes=9):%0A    # Create initial value%0A    X = np.random.uniform(1, classes + 1, size=(items, 1))%0A%0A    # Create targe by incrementing%0A    t = np.zeros((items, 2))%0A    t%5B:, 0%5D = np.floor(X%5B:, 0%5D)%0A%0A    return Dataset(%0A        X.astype('float32'),%0A        t.astype('int32'),%0A        classes + 1%0A    )%0A%0Adef memorize(items, classes=9):%0A    # Create initial value%0A    X = np.random.randint(1, classes + 1, size=(items, 1))%0A%0A    # Create targe by incrementing%0A    t = np.zeros((items, 10))%0A    for i, x_i in enumerate(X%5B:, 0%5D):%0A        t%5Bi, 0:x_i%5D = np.arange(1, x_i + 1)%0A%0A    return Dataset(%0A        X.astype('float32'),%0A        t.astype('int32'),%0A        classes + 1%0A    )%0A

add floor and memorize as datasets