Esempio n. 1
0
def main():
    i_gen = InputGenerator(0, T, dt)
    data = i_gen.generate_lorenz()
    num_train = int(len(data.T) * RATIO_TRAIN)
    train_data = data.T[:num_train]
    print(f"train_data_shape: {train_data.shape}")

    model = ReservoirNetWork(inputs=train_data,
                             num_input_nodes=NUM_INPUT_NODES,
                             num_reservoir_nodes=NUM_RESERVOIR_NODES,
                             num_output_nodes=NUM_OUTPUT_NODES,
                             leak_rate=LEAK_RATE)
    model.train()
    train_result = model.get_train_result()  # 訓練の結果を取得

    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    ax.scatter(data[0], data[1], data[2], marker='o')

    ax.set_title("Echo State Network Sin Prediction")
    ax.set_xlabel("x")
    ax.set_ylabel("y")
    ax.set_zlabel("z")
    plt.show()