model_paths = [f.path for f in os.scandir(valPath) if f.is_dir()] inDims = range(1, 2) outDims = range(1, 2) for (inDimension, outDimension) in zip(inDims, outDims): name = 'MIMO ' + str(inDimension) + 'x' + str(outDimension) path = valPath + name + '/Checkpoints/' start_time = time.time() numTrials = int(NUMTRIALS / (inDimension * outDimension)) sig = Signal(inDimension, outDimension, numTrials, numPlots=plots) # In this case, since we are only loading the model, not trying to train it, # we can use function simulate and preprocess sig.system_validation_multi() 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) #start_time = time.time() kps = np.zeros(1000) taus = np.zeros(1000) # Function to make predictions based off the simulation a, b = yData.shape inlet = yData - uData inlet = inlet.reshape((a, b, 1))
model_paths = [f.path for f in os.scandir(valPath) if f.is_dir()] inDims = range(1,2) outDims = range(1,2) for (inDimension,outDimension) in zip(inDims,outDims): name ='MIMO ' + str(inDimension) + 'x' + str(outDimension) path = valPath + name + '/Checkpoints/' start_time = time.time() numTrials=int(NUMTRIALS/(inDimension*outDimension)) sig = Signal(inDimension,outDimension,numTrials,numPlots=plots) # 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.system_validation_multi(disturbance=False,a_possible_values=[0.01,0.99],b_possible_values=[0.01,0.99],k_possible_values=[0,1],not_prbs=False) print("--- %s seconds ---" % (time.time() - start_time)) xData=sig.PRBS() xData = sig.random_process() # Initialize the models that are saved using the parameters declared above predictor = Model() predictor.load_model(sig,path) #xData=np.sin(np.linspace(0,300)) x=(xData) + 1 huh = (scipy.stats.entropy(x)) # Function to make predictions based off the simulation kp_yhat = predictor.predict_multinomial(sig,stepResponse=False)
ellipse.set_transform(transf + ax.transData) return ax.add_patch(ellipse) for (inDimension, outDimension) in zip(inDims, outDims): name = 'MIMO ' + str(inDimension) + 'x' + str(outDimension) path = valPath + name + '/Checkpoints/' start_time = time.time() numTrials = int(NUMTRIALS / (inDimension * outDimension)) sig = Signal(inDimension, outDimension, numTrials, numPlots=plots) # 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.system_validation_multi(disturbance=False, b_possible_values=[.299, .3005], a_possible_values=[.899, .9005], k_possible_values=[0, 1]) 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) sns.set_style('dark') # Function to make predictions based off the simulation kp_yhat = predictor.predict_multinomial(sig, stepResponse=False) #tau_yhat = self.modelDict['tau'](sig.xData['tau']) #theta_yhat = self.modelDict['theta'](sig.xData['theta']) fig, ax_nstd = plt.subplots(figsize=(6, 6), dpi=200) #ax_nstd.set_xlim([0.475,0.535]) #ax_nstd.set_ylim([0.475,0.535])