Ejemplo n.º 1
0
def random():

    if os.path.exists("log") is False:
        os.mkdir("log")

    if os.path.exists("model") is False:
        os.mkdir("model")

    loader_test = DataLoader()

    loader_test.load_xls("dlt2.xls")

    rnn = ModelRNN("log",
                   "model",
                   lstm_size=128,
                   num_layers=2,
                   learning_rate=0.001)

    rnn.build_lstm_model_lstm(1,
                              loader_test.get_seq_len(),
                              1,
                              loader_test.get_classes_count(),
                              test_mode=True)

    rnn.predict(loader_test, 16, None)
Ejemplo n.º 2
0
def train():

    print("run...")

    if os.path.exists("log") is False:
        os.mkdir("log")

    if os.path.exists("model") is False:
        os.mkdir("model")

    loader = DataLoader()

    loader.load_xls("dlt2.xls")

    rnn = ModelRNN("log",
                   "model",
                   lstm_size=128,
                   num_layers=2,
                   learning_rate=0.001)

    rnn.build_lstm_model_lstm(32,
                              loader.get_seq_len(),
                              1,
                              loader.get_classes_count(),
                              test_mode=False)

    rnn.train(loader)