Пример #1
0
inDims = range(1, 2)
outDims = range(1, 2)

for (inDimension, outDimension) in zip(inDims, outDims):
    name = 'MIMO ' + '1' + 'x' + '1'
    path = valPath + name + '/Checkpoints/'

    start_time = time.time()
    numTrials = int(NUMTRIALS / (inDimension * outDimension))
    sig = Signal(inDimension,
                 outDimension,
                 numTrials,
                 numPlots=plots,
                 stdev='variable')

    # In this case, since we are only loading the model, not trying to train it,
    # we can use function simulate and preprocess
    xData, yData = sig.closed_loop_validation(b_possible_values=[.01, .99],
                                              a_possible_values=[.01, .99],
                                              k_possible_values=[1, 10],
                                              order=False)
    print("--- %s seconds ---" % (time.time() - start_time))

    # Initialize the models that are saved using the parameters declared above
    predictor = Model()
    predictor.load_model(sig, path)

    # Function to make predictions based off the simulation
    predDict, errDict = predictor.predict_system(sig,
                                                 savePredict=True,
                                                 stepResponse=False)