代码拉取完成,页面将自动刷新
import numpy as np
from models import interpolation , SRCNN_train , SRCNN_predict , DNCNN_train
from scipy.io import loadmat
if __name__ == "__main__":
# Load datasets
real = loadmat("Perfect_"+ ""VehA".mat")["My_perfect_H"]
noisy_input = loadmat("Noisy_" + "VehA" + "_" + "SNR_" + "22" + ".mat") ["VehA"+"_noisy_"+ str(SNR)]
interp_noisy = interpolation(noisy_input , SNR , 48 , 'rbf')
real_image = np.zeros((len(real),72,14,2))
real_image[:,:,:,0] = np.real(real)
real_image[:,:,:,1] = np.imag(real)
real_image = np.concatenate((real_image[:,:,:,0], real_image[:,:,:,1]), axis=0).reshape(2*len(real), 72, 14, 1)
# Train SRCNN
idx_random = np.random.rand(len(real_image)) < (1/9) # uses 32000 from 36000 as training and the rest as validation
val_data, val_label = interp_noisy[~idx_random,:,:,:] , real_image[~idx_random,:,:,:]
train_data, train_label = interp_noisy[idx_random,:,:,:] , real_image[idx_random,:,:,:]
SRCNN_train(train_data ,train_label, val_data , val_label , "VehA" , 48 , SNR )
# Predict
srcnn_pred_train = SRCNN_predict(train_data, "VehA" , num_pilots , SNR)
srcnn_pred_validation = SRCNN_predict(train_data, "VehA" , num_pilots , SNR)
# Train DNCNN
DNCNN_train(input_data, "VehA" , num_pilots , SNR)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。