lr_decay = (final_lr / lr)**(1. / n_epoch)

    # layer's parameters
    n_inputs = 27
    n_units = 2000
    n_classes = 27
    n_hidden_layer = 1

    # binary/ternary weights for LSTM
    binary_training = True
    ternary_training = False
    stochastic_training = True

    print('Preparing the dataset')
    train_set = get_stream(which_set="train",
                           batch_size=batch_size,
                           length=length,
                           augment=True)
    valid_set = get_stream(which_set="valid",
                           batch_size=batch_size,
                           length=length)
    test_set = get_stream(which_set="test",
                          batch_size=batch_size,
                          length=length)

    print('Creating the model')

    class create_model(Network):
        def __init__(self, rng):

            Network.__init__(self,
                             n_hidden_layer=n_hidden_layer,
    final_lr = 0.001
    lr_decay = (final_lr / lr)**(1. / n_epoch)

    # layer's parameters
    n_inputs = 1
    n_units = 100
    n_classes = 10
    n_hidden_layer = 1

    # binary/ternary weights for LSTM
    binary_training = False
    ternary_training = False
    stochastic_training = True

    print('Preparing the dataset')
    train_set = get_stream(which_set="train", batch_size=batch_size)
    valid_set = get_stream(which_set="valid", batch_size=batch_size)
    test_set = get_stream(which_set="test", batch_size=batch_size)

    print('Creating the model')

    class create_model(Network):
        def __init__(self, rng):

            Network.__init__(self,
                             n_hidden_layer=n_hidden_layer,
                             BN_LSTM=BN_LSTM,
                             length=length)

            print("LSTM layer:")
            self.layer.append(