x_Feed, H_Feed, y_Feed, noise_sigma2_Feed = gen_data.dataTrain( 0, params['SNR_dB_train']) # 固定信道 data_Feed = { 'x': x_Feed, 'y': y_Feed, 'H': H_Feed, 'noise_sigma2': noise_sigma2_Feed, } model_train(sess, MMNet_nodes, data_Feed) if epoch % 100 == 0: print('4', noise_sigma2_Feed) print('5', model_est(sess, MMNet_nodes, data_Feed)) print('===========epoch%d,now_time is %s=========' % (epoch + n * params['maxEpoch'], datetime.datetime.now().strftime('%X'))) ser_MMNet, loss = model_loss(sess, MMNet_nodes, data_Feed) print('ser_MMNet', ser_MMNet, 'loss=', loss, '\n') loss_MMNet.append(loss) loss_all['MMNet'] = loss_MMNet train_ed = time.time() print("MMNet Train time is: " + str(train_ed - train_st)) # Testing results = { 'SNR_dBs': np.arange(params['SNR_dB_min_test'], params['SNR_dB_max_test'], params['SNR_step_test']) } ser_MMNets = model_eval(sess, params, MMNet_nodes, gen_data, params['test_iterations']) results['ser_MMNets'] = ser_MMNets
for n in range(params['nRounds']): for epoch in range(params['maxEpoch']): x_Feed, H_Feed, y_Feed, noise_sigma2_Feed = gen_data.dataTrain( epoch, params['SNR_dB_train']) data_Feed = { 'x': x_Feed, 'y': y_Feed, 'H': H_Feed, 'noise_sigma2': noise_sigma2_Feed, } model_train(sess, DetNet_nodes, data_Feed) if epoch % 1000 == 0: print('===========epoch%d,now_time is %s=========' % (epoch + n * params['maxEpoch'], datetime.datetime.now().strftime('%X'))) ser_DetNet, loss = model_loss(sess, DetNet_nodes, data_Feed) print('ser_DetNet', ser_DetNet, 'loss=', loss, '\n') loss_DetNet.append(loss) loss_all['DetNet'] = loss_DetNet # 损失值 train_ed = time.time() print("DetNet Train time is: " + str(train_ed - train_st)) if 'OAMPNet' in params['simulation_algorithms']: loss_OAMPNet = [] print('===========OAMPNet is Training, now_time is %s=========' % (datetime.datetime.now().strftime('%X'))) train_st = time.time() for n in range(params['nRounds']): for epoch in range(params['maxEpoch']): x_Feed, H_Feed, y_Feed, noise_sigma2_Feed = gen_data.dataTrain( epoch, params['SNR_dB_train'])
for epoch in range(params['maxEpoch']): # x_Feed, H_Feed, y_Feed, noise_sigma2_Feed = gen_data.dataTrain(epoch, params['SNR_dB_train']) x_Feed, H_Feed, y_Feed, noise_sigma2_Feed = gen_data.dataTrain( epoch, params['SNR_dB_train']) # 固定信道 data_Feed = { 'x': x_Feed, 'y': y_Feed, 'H': H_Feed, 'noise_sigma2': noise_sigma2_Feed, } model_train(sess, DetNetSIC2_nodes, data_Feed) if epoch % 100 == 0: print('===========epoch%d,now_time is %s=========' % (epoch + n * params['maxEpoch'], datetime.datetime.now().strftime('%X'))) ser, loss = model_loss(sess, DetNetSIC2_nodes, data_Feed) print('ser', ser, 'loss=', loss, '\n') loss_all.append(loss) train_ed = time.time() print("Train time is: " + str(train_ed - train_st)) # Testing results = { 'SNR_dBs': np.arange(params['SNR_dB_min_test'], params['SNR_dB_max_test'], params['SNR_step_test']) } sers = model_eval(sess, params, DetNetSIC2_nodes, gen_data, params['test_iterations']) results['ser_DetNetSIC2s'] = sers print(sers)
print('=========== is Training, now_time is %s=========' % (datetime.datetime.now().strftime('%X'))) train_st = time.time() for n in range(params['nRounds']): for epoch in range(params['maxEpoch']): x_Feed, H_Feed, y_Feed, noise_sigma2_Feed = gen_data.dataTrain(epoch, params['SNR_dB_train']) data_Feed = { 'x': x_Feed, 'y': y_Feed, 'H': H_Feed, 'noise_sigma2': noise_sigma2_Feed, } model_train(sess, DetNetSIC3_node1, data_Feed) if epoch % 100 == 0: print('===========epoch%d,now_time is %s=========' % (epoch + n*params['maxEpoch'], datetime.datetime.now().strftime('%X'))) ser, loss = model_loss(sess, DetNetSIC3_node1, data_Feed) print('ser', ser, 'loss=', loss, '\n') train_ed = time.time() print("Train time is: "+str(train_ed-train_st)) train_st = time.time() for n in range(params['nRounds']): for epoch in range(params['maxEpoch']): x_Feed, H_Feed, y_Feed, noise_sigma2_Feed = gen_data.dataTrain(epoch, params['SNR_dB_train']) data_Feed = { 'x': x_Feed, 'y': y_Feed, 'H': H_Feed, 'noise_sigma2': noise_sigma2_Feed, } model_train(sess, DetNetSIC3_node2, data_Feed)