Đồ án tốt nghiệp Đại học: Nghiên cứu lập lịch biểu các liên kết không dây dựa trên cơ sở Deep Learning

108 0 0
Đồ án tốt nghiệp Đại học: Nghiên cứu lập lịch biểu các liên kết không dây dựa trên cơ sở Deep Learning

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

HỌC VIỆN KỸ THUẬT QUÂN SỰ HỌ VÀ TÊN : LÊ THỊ BÌNH NGUYỄN THỊ KHÁNH LINH KHĨA : 53 HỆ ĐÀO TẠO : DÀI HẠN ĐỒ ÁN TỐT NGHIỆP ĐẠI HỌC CHUYÊN NGÀNH: THÔNG TIN NGHIÊN CỨU LẬP LỊCH BIỂU CÁC LIÊN KẾT KHÔNG DÂY DỰA TRÊN CƠ SỞ DEEP LEARNING NĂM 2022 HỌC VIỆN KỸ THUẬT QUÂN SỰ HỌ VÀ TÊN: LÊ THỊ BÌNH NGUYỄN THỊ KHÁNH LINH KHÓA: 53 HỆ ĐÀO TẠO: DÀI HẠN ĐỒ ÁN TỐT NGHIỆP ĐẠI HỌC NGÀNH: KỸ THUẬT ĐIỆN TỬ - VIỄN THÔNG MÃ SỐ: 7520207 NGHIÊN CỨU LẬP LỊCH BIỂU CÁC LIÊN KẾT KHÔNG DÂY DỰA TRÊN CƠ SỞ DEEP LEARNING Cán hướng dẫn khoa học: Trung tá, TS, Nguyễn Thu Phương NĂM 2022 HỌC VIỆN KỸ THUẬT QUÂN SỰ CỘNG HỊA XÃ HỘI CHỦ NGHĨA VIỆT NAM KHOA VƠ TUYẾN ĐIỆN TỬ Độc lập - Tự - Hạnh phúc BỘ MÔN THÔNG TIN NHIỆM VỤ ĐỒ ÁN TỐT NGHIỆP Họ tên: Lê Thị Bình Nguyễn Thị Khánh Linh Lớp: Thơng tin, Khóa: 53 Lớp: Thơng tin, Khóa: 53 Ngành: Kỹ thuật điện tử - viễn thông, Chuyên ngành: Thông tin Tên đề tài: Nghiên cứu lập lịch biểu liên kết không dây dựa sở Deep learning Các số liệu ban đầu: Quyết định Giao đồ án tốt nghiệp đại học - Học viện Kỹ thuật Quân sự; Nhiệm vụ giao tài liệu tham khảo Nội dung thuyết minh: Lời nói đầu Chương 1: Tổng quan tốn lập lịch biểu liên kết không dây kỹ thuật học sâu Chương 2: Phương pháp “học để tối ưu” Chương 3: Lập lịch biểu liên kết không dây dựa sở học sâu Kết luận Tài liệu tham khảo Phụ lục Số lượng, nội dung vẽ sản phẩm cụ thể: Không Cán hướng dẫn: Trung tá, TS, Nguyễn Thu Phương; Phó chủ nhiệm Bộ mơn Thơng tin, Khoa Vơ tuyến điện tử - Học viện Kỹ thuật Quân sự; Hướng dẫn toàn Ngày giao: 01/7/2022 Ngày hoàn thành: 31/10/2022 Hà Nội, ngày 31 tháng 10 năm 2022 Chủ nhiệm môn Cán hướng dẫn Trung tá, TS, Nguyễn Thu Phương Học viên thực Đã hoàn thành nộp đồ án ngày 31 tháng 10 năm 2022 Lê Thị Bình Nguyễn Thị Khánh Linh i MỤC LỤC MỤC LỤC i DANH MỤC TỪ VIẾT TẮT iii DANH MỤC HÌNH ẢNH v DANH MỤC BẢNG BIỂU vii LỜI NÓI ĐẦU CHƯƠNG 1: TỔNG QUAN VỀ BÀI TỐN LẬP LỊCH BIỂU LIÊN KẾT KHƠNG DÂY VÀ KỸ THUẬT HỌC SÂU 1.1 Bài toán lập lịch biểu liên kết không dây 1.1.1 Khái niệm toán lập lịch biểu 1.1.2 Cơng thức tốn lập lịch biểu 1.1.3 Các phương pháp tiếp cận truyền thống 1.2 Kỹ thuật học sâu 11 1.2.1 Một số khái niệm học sâu 11 1.2.2 Ứng dụng học sâu đời sống 13 1.2.3 Ứng dụng học sâu vào truyền thông không dây 16 1.3 Kết luận Chương 19 CHƯƠNG 2: PHƯƠNG PHÁP “HỌC ĐỂ TỐI ƯU” 20 2.1 Cơ sở lý thuyết 20 2.1.1 Thông tin trạng thái kênh 20 2.1.2 Thuật toán tối thiểu hóa có trọng số sai số trung bình bình phương 21 2.2 Phương pháp “học để tối ưu” 24 2.2.1 Mạng nơ-ron sâu 24 2.2.2 Thuật toán suy giảm gradient 27 2.2.3 Xấp xỉ phổ quát 30 2.3 Thiết lập hệ thống 34 2.3.1 Kiến trúc mạng 34 ii 2.3.2 Tạo liệu 34 2.3.3 Giai đoạn huấn luyện 35 2.3.4 Giai đoạn kiểm thử 35 2.4 Mô hệ thống 35 2.4.1 Thiết lập mô 35 2.4.2 Đánh giá hệ thống 39 2.5 Kết luận Chương 45 CHƯƠNG 3: LẬP LỊCH BIỂU CÁC LIÊN KẾT KHÔNG DÂY DỰA TRÊN CƠ SỞ HỌC SÂU 47 3.1 Lập lịch biểu liên kết không dây dựa lập trình phân số 47 3.1.1 Tổng quan phương pháp 47 3.1.2 Một số phương pháp lập lịch biểu 49 3.1.3 Lập trình phân số 53 3.1.4 Tái định dạng Lagrange 56 3.1.5 Kết hợp lập lịch biểu điều khiển công suất 60 3.1.6 Đánh giá hệ thống 61 3.2 Lập lịch biểu liên kết không dây dựa học sâu 63 3.2.1 Học dựa thơng tin vị trí địa lý 63 3.2.2 Xây dựng đầu vào cho mạng nơ-ron không gian 65 3.2.3 Kiến trúc mạng nơ-ron sâu không gian 66 3.2.4 Quá trình huấn luyện 71 3.2.5 Phá vỡ tính đối xứng 72 3.3 Đánh giá hệ thống 74 3.4 Kết luận Chương 77 KẾT LUẬN 79 TÀI LIỆU THAM KHẢO 82 PHỤ LỤC 84 iii DANH MỤC TỪ VIẾT TẮT Tên viết tắt Tên tiếng Anh Nghĩa tiếng Việt AWGN Additive White Gaussian Noise Tạp âm Gauss trắng cộng tính BS Base Station Trạm gốc CPU Central Processing Unit Bộ xử lý trung tâm CSI Channel State Information Thông tin trạng thái kênh DNN Deep Neural Network Mạng nơ-ron sâu D2D Device-to-Device Thiết bị tới thiết bị FP Fractional Programming Lập trình phân số FPLinQ Fractional-Programming Link Scheduling Lập lịch biểu liên kết dựa lập trình phân số GD Gradient Descent Suy giảm gradient GDoF Generalized Degree-of-Freedom Bậc tự tổng quát GIC Gaussian Interference Channel Kênh nhiễu Gauss GLI Geographic Location Information Thơng tin vị trí địa lý GPU Graphics Processing Unit Bộ xử lý đồ họa IMAC Interfering Multiple Access Channel Kênh đa truy cập nhiễu ITIS Information-Theoretic Independent Sets Các tập độc lập lý thuyết thông tin iv Tên viết tắt Tên tiếng Anh Nghĩa tiếng Việt ITLinQ Information-Theoretic Link Scheduling Lập lịch biểu liên kết lý thuyết thông tin ITLinQ+ Information-Theoretic Link Scheduling Plus Lập lịch biểu liên kết lý thuyết thông tin nâng cao OFDM Orthogonal Frequency Division Multiplexing Ghép kênh phân chia theo tần số trực giao ReLU Rectified Linear Unit Đơn vị tuyến tính chỉnh lưu RMSprop Root Mean Square Propagation Truyền lan giá trị hiệu dụng SINR Signal-to-Interference-plusNoise Ratio Tỷ số tín hiệu tạp âm cộng nhiễu SIR Signal-to-Interference Ratio Tỷ số tín hiệu nhiễu SNR Signal-to-Noise Ratio Tỷ số tín hiệu tạp âm TIN Treat-Interference-as-Noise Coi nhiễu tạp âm WMMSE Weighted Minimization of Mean Square Error Tối thiểu hóa có trọng số sai số trung bình bình phương v DANH MỤC HÌNH ẢNH Hình 1.1 Mơ hình liên kết không dây Hình 1.2 Mạng D2D Hình 1.3 Xe điện tự hành cấp độ 2-3 VF31 VinFast 14 Hình 1.4 Ứng dụng học sâu Trợ lý ảo 15 Hình 1.5 Ứng dụng học sâu Nhận diện hình ảnh 16 Hình 1.6 Ứng dụng học sâu Tính dịch tự động 16 Hình 1.7 Ứng dụng học sâu Truyền thơng khơng dây 17 Hình 2.1 Phương pháp sử dụng DNN để “học cách tối ưu hóa” 25 Hình 2.2 Mạng nơ-ron kết nối đầy đủ nông 26 Hình 2.3 Đồ thị tính toán mạng nơ-ron 27 Hình 2.4 Sử dụng DNN để xấp xỉ hàm liên tục 28 Hình 2.5 GD loạt tập mức 29 Hình 2.6 Sử dụng DNN để xấp xỉ hành vi GD 32 Hình 2.7 Mạng nơ-ron sâu sử dụng để xấp xỉ WMMSE 34 Hình 2.8 Kênh đa truy cập nhiễu với K = 7, N = 28 37 Hình 2.9 Lựa chọn tham số cho kênh GIC 38 Hình 2.10 Hàm phân phối tích lũy 40 Hình 2.11 Phân phối DNN-CSI WMMSE tồn tập kiểm thử 42 Hình 3.1 Trường hợp đặc biệt ITLinQ ITLinQ+ 53 Hình 3.2 Tối đa hóa tốc độ tổng mạng D2D 62 Hình 3.3 Tỷ lệ liên kết kích hoạt lịch biểu tối đa hóa tốc độ tổng 63 Hình 3.4 Các lưới mật độ thu phát 65 Hình 3.5 Bộ lọc tích chập khơng gian huấn luyện 67 Hình 3.6 Đường tính tốn thuận tiếp cho cặp máy phát máy thu 69 vi Hình 3.7 Kiến trúc mạng nơ-ron tổng thể 71 Hình 3.8 Hiện tượng dao động đặc biệt trình huấn luyện mạng nơ-ron 73 Hình 3.9 Phân phối tích lũy tốc độ tổng bố cục mạng 77 Hình 3.10 Lịch biểu DNN-GLI số bố cục ngẫu nhiên 77 83 [9] G Cybenko, “Approximation by superpositions of a sigmoidal function,” Mathematics of Control, Signals, and Systems, vol 2, no 4, pp 303–314, Dec 1989 [10] H Mhaskar, Q Liao, T Poggio, “Learning functions: When is deep better than shallow,” CoRR, vol abs/1603.00988, May 2016 [11] Wikipedia, “Gradient descent — Wikipedia, the free encyclopedia.” http://en.wikipedia.org/w/index.php?title=Gradient% 20descent&oldid=1113806258, 2022 [12] K Shen, W Yu, “FPLinQ: A cooperative spectrum sharing strategy for device-to-device communications,” IEEE International Symposium on Information Theory, pp 2323–2327, June 2017 [13] X Wu, S Tavildar, S Shakkottai, T Richardson, J Li, R Laroia, A Jovicic, “FlashLinQ: A synchronous distributed scheduler for peer-to-peer ad hoc networks,” IEEE/ACM Transactions on Networking, vol 21, no 4, pp 1215–1228, Aug 2013 [14] N Naderializadeh, A S Avestimehr, “ITLinQ: A new approach for spectrum sharing in device-to-device communication systems,” IEEE International Symposium on Information Theory, vol 32, no 6, pp 1139– 1151, June 2014 [15] K Shen, W Yu, “Fractional programming for communication systems—Part I: Power control and beamforming,” IEEE Transactions on Signal Processing, vol 66, no 10, pp 2616–2630, May 2018 84 PHỤ LỤC (Code đánh giá hiệu suất tốc độ tổng DNN-GLI so với phương pháp điểm chuẩn) """general_parameters.py""" # thiet lap tham so mo phong chung import numpy as np class parameters: def init (self): self.n_links = 50 self.field_length = 1000 self.shortest_directLink_length = self.longest_directLink_length = 65 self.shortest_crossLink_length = self.bandwidth = 5e6 self.carrier_f = 2.4e9 self.tx_height = 1.5 self.rx_height = 1.5 self.antenna_gain_decibel = 2.5 self.tx_power_milli_decibel = 40 self.tx_power = np.power(10, (self.tx_power_milli_decibel - 30) / 10) self.noise_density_milli_decibel = -169 self.input_noise_power = np.power(10, ((self.noise_density_milli_decibel - 30) / 10)) * self.bandwidth self.output_noise_power = self.input_noise_power self.SNR_gap_dB = self.SNR_gap = np.power(10, self.SNR_gap_dB / 10) self.setting_str = 85 "{}_links_{}X{}_{}_{}_length".format(self.n_links, self.field_length, self.field_length, self.shortest_directLink_length, self.longest_directLink_length) self.cell_length = self.n_grids = np.round(self.field_length / self.cell_length).astype(int) """cnn_model.py""" # xay dung kien truc mang no-ron tich chap import tensorflow.compat.v1 as tf import os tf.disable_v2_behavior() class Conv_Network: def init (self, general_para, batch_size): self.outputs_final = None self.parameters = general_para self.N = self.parameters.n_links self.batch_size = batch_size self.stddev_init = 0.01 self.learning_rate = 1e-4 self.n_grids = self.parameters.n_grids self.filter_size = 63 self.n_grids = self.parameters.n_grids self.n_feedback_steps = 20 self.placeholders = dict() self.TFgraph = tf.Graph() self.model_filename = os.path.join(os.path.dirname(os.path.abspath( file )), 86 "Trained_Model", "conv_net_model.ckpt") print("[cnn_model] model path: ", self.model_filename) def prepare_placeholders(self): tx_indices_hash = tf.placeholder(tf.int64, shape=[self.batch_size * self.N, 4], name=’tx_indices_placeholder’) rx_indices_hash = tf.placeholder(tf.int64, shape=[self.batch_size * self.N, 4], name=’rx_indices_placeholder’) tx_indices_extract = tf.placeholder(tf.int32, shape=[self.batch_size, self.N, 3], name=’tx_indices_extract_placeholder’) rx_indices_extract = tf.placeholder(tf.int32, shape=[self.batch_size, self.N, 3], name=’rx_indices_extract_placeholder’) pair_tx_convfilter_indices = tf.placeholder(tf.int32, shape=[self.batch_size, self.N, 2], name=’pair_tx_convfilter_indices_placeholder’) pair_rx_convfilter_indices = tf.placeholder(tf.int32, shape=[self.batch_size, self.N, 2], name=’pair_rx_convfilter_indices_placeholder’) schedule_label = tf.placeholder(tf.float32, shape=[self.batch_size, self.N], name=’scheduling_target_placeholder’) self.placeholders[’tx_indices_hash’] = tx_indices_hash self.placeholders[’rx_indices_hash’] = rx_indices_hash self.placeholders[’tx_indices_extract’] = tx_indices_extract self.placeholders[’rx_indices_extract’] = rx_indices_extract self.placeholders[’pair_tx_convfilter_indices’] = pair_tx_convfilter_indices 87 self.placeholders[’pair_rx_convfilter_indices’] = pair_rx_convfilter_indices self.placeholders[’schedule_label’] = schedule_label self.placeholders[’subset_links’] = tf.placeholder_with_default(input=tf.ones([self.batch_size, self.N]), shape=[self.batch_size, self.N], name=’subset_links_placeholder’) print("[cnn_model] placeholder preparation finished") return def prepare_parameters(self): with tf.variable_scope("conv_lyr"): weights = tf.get_variable(name="w", shape=[self.filter_size, self.filter_size, 1, 1], initializer=tf.constant_initializer(0)) bias = tf.get_variable(name="b", shape=[], initializer=tf.constant_initializer(-3)) tf.add_to_collection("conv", weights) tf.add_to_collection("conv", bias) with tf.variable_scope("fc_lyr1"): weights = tf.get_variable(name="w", shape=[6, 30], initializer=tf.truncated_normal_initializer( stddev=self.stddev_init)) biases = tf.get_variable(name="b", shape=[30], initializer=tf.constant_initializer(0)) tf.add_to_collection("fc", weights) tf.add_to_collection("fc", biases) with tf.variable_scope("fc_lyr2"): weights = tf.get_variable(name="w", shape=[30, 30], initializer=tf.truncated_normal_initializer( stddev=self.stddev_init)) 88 biases = tf.get_variable(name="b", shape=[30], initializer=tf.constant_initializer(0)) tf.add_to_collection("fc", weights) tf.add_to_collection("fc", biases) with tf.variable_scope("fc_lyr3"): weights = tf.get_variable(name="w", shape=[30, 1], initializer=tf.truncated_normal_initializer( stddev=self.stddev_init)) bias = tf.get_variable(name="b", shape=[], initializer=tf.constant_initializer(0)) tf.add_to_collection("fc", weights) tf.add_to_collection("fc", bias) print("[cnn_model] parameters preparation") return def convolution_layer(self, inputs, filters, bias): return tf.add(tf.nn.conv2d(inputs, filters, strides=[1, 1, 1, 1], padding="SAME"), bias) def fully_connected_layer(self, inputs, weights, biases): return tf.nn.relu(tf.add(tf.matmul(inputs, weights), biases)) def fully_connected_layer_final(self, inputs, weights, bias): return tf.add(tf.matmul(inputs, weights), bias) def iteration_step(self, allocs_state, placeholders): grid_values = tf.reshape(allocs_state, [self.batch_size * self.N]) tx_grids = tf.SparseTensor(placeholders[’tx_indices_hash’], grid_values,[self.batch_size, self.n_grids, self.n_grids, 1]) 89 tx_grids = tf.sparse_reduce_sum(tx_grids, reduction_axes=3, keepdims=True) rx_grids = tf.SparseTensor(placeholders[’rx_indices_hash’], grid_values, [self.batch_size, self.n_grids, self.n_grids, 1]) rx_grids = tf.sparse_reduce_sum(rx_grids, reduction_axes=3, keepdims=True) with tf.variable_scope("conv_lyr", reuse=True): weights = tf.get_variable(name="w") bias = tf.get_variable(name="b") tx_density_map_full = self.convolution_layer(tx_grids, tf.exp(weights), tf.exp(bias)) rx_density_map_full = self.convolution_layer(rx_grids, tf.exp(weights), tf.exp(bias)) pairing_tx_strength_full = tf.gather_nd(params=tf.squeeze(tf.exp(weights)), indices=placeholders[’pair_tx_convfilter_indices’]) pairing_rx_strength_full = tf.gather_nd(params=tf.squeeze(tf.exp(weights)), indices=placeholders[’pair_rx_convfilter_indices’]) pairing_tx_contrib_full = pairing_tx_strength_full * allocs_state pairing_rx_contrib_full = pairing_rx_strength_full * allocs_state tx_surroundings_full = tf.gather_nd(params=tf.squeeze(rx_density_map_full, axis=-1), indices=placeholders[’tx_indices_extract’]) pairing_rx_contrib_full rx_surroundings_full = tf.gather_nd(params=tf.squeeze(tx_density_map_full, axis=-1), indices=placeholders[’rx_indices_extract’]) - 90 pairing_tx_contrib_full direct_link_strength = pairing_tx_strength_full direct_link_strength_max = tf.tile(tf.reduce_max(direct_link_strength, axis=-1, keepdims=True), [1, self.N]) direct_link_strength_min = tf.tile(tf.reduce_min(direct_link_strength, axis=-1, keepdims=True), [1, self.N]) pairs_features = tf.stack([tx_surroundings_full, rx_surroundings_full, direct_link_strength, direct_link_strength_max, direct_link_strength_min, allocs_state], axis=-1) with tf.variable_scope("fc_lyr1", reuse=True): weights = tf.get_variable(name="w") biases = tf.get_variable(name="b") pairs_features = tf.reshape(pairs_features, [-1, 6]) fc_lyr1_outputs = self.fully_connected_layer(pairs_features, weights, biases) with tf.variable_scope("fc_lyr2", reuse=True): weights = tf.get_variable(name="w") bias = tf.get_variable(name="b") fc_lyr2_outputs = self.fully_connected_layer(fc_lyr1_outputs, weights, bias) with tf.variable_scope("fc_lyr3", reuse=True): weights = tf.get_variable(name="w") bias = tf.get_variable(name="b") fc_lyr3_outputs = self.fully_connected_layer_final(fc_lyr2_outputs, weights, bias) 91 network_outputs = tf.reshape(fc_lyr3_outputs, [-1, self.N]) return network_outputs def build_network(self): with self.TFgraph.as_default(): self.prepare_placeholders() self.prepare_parameters() allocs_state = tf.ones(shape=[self.batch_size, self.N]) * self.placeholders[’subset_links’] for i in range(self.n_feedback_steps): allocs_state_logits = self.iteration_step(allocs_state, self.placeholders) stochastic_mask = tf.cast(tf.random_uniform(shape=[self.batch_size, self.N]) >= 0.5, tf.float32) allocs_state = allocs_state * (tf.ones([self.batch_size, self.N], tf.float32) stochastic_mask) + tf.sigmoid(allocs_state_logits) * stochastic_mask allocs_state = allocs_state * self.placeholders[’subset_links’] self.outputs_final = tf.cast(allocs_state >= 0.5,tf.int32, name="casting_to_scheduling_output") print("[cnn_model] tensorflow graph built successfully!") return """dnn_gli.py""" # lap lich bieu DNN-GLI import numpy as np 92 import conv_net import helper_functions import matplotlib.pyplot as plt import tensorflow.compat.v1 as tf import os tf.disable_v2_behavior() def scheduling(general_para, layouts): N = general_para.n_links n_layouts = np.shape(layouts)[0] neural_net = cnn_model.Conv_Network(general_para, n_layouts) neural_net.build_network() neural_net_inputs = helper_functions.process_layouts_inputs(general_para, layouts) with neural_net.TFgraph.as_default(): saver = tf.train.Saver() with tf.Session() as sess: saver.restore(sess, neural_net.model_filename) print("[dnn_gli] restored model from: {}!".format(neural_net.model_filename)) schedules = sess.run(neural_net.outputs_final, feed_dict={neural_net.placeholders[’tx_indices_hash’]: neural_net_inputs[’tx_indices_hash’], neural_net.placeholders[’rx_indices_hash’]: neural_net_inputs[’rx_indices_hash’], neural_net.placeholders[’tx_indices_extract’]: neural_net_inputs[’tx_indices_ext’], neural_net.placeholders[’rx_indices_extract’]: neural_net_inputs[’rx_indices_ext’], neural_net.placeholders[’pair_tx_convfilter_indices’]: neural_net_inputs[’pair_tx_convfilter_indices’], 93 neural_net.placeholders[’pair_rx_convfilter_indices’]: neural_net_inputs[’pair_rx_convfilter_indices’]}) schedules = np.array(schedules) assert np.shape(schedules) == (n_layouts, N), "[dnn_gli] Wrong shape: {}".format(np.shape(schedules)) print("[dnn_gli] successfully compute DNN-GLI’s schedules") return schedules """benchmarks.py""" # tinh toan cac diem chuan import numpy as np import FPLinQ import helper_functions def FP(general_para, gains, weights): n_layouts, N, _ = np.shape(gains) assert N == general_para.n_links assert np.shape(weights) == (n_layouts, N) FP_allocs = FPLinQ.FP_optimize(general_para, gains, weights) FP_schedules = (np.sqrt(FP_allocs) > 0.5).astype(int) return FP_schedules def Greedy(general_para, gains_diagonal, gains_nondiagonal, prop_weights): n_layouts, N = np.shape(gains_diagonal) assert np.shape(prop_weights) == (n_layouts, N) SNRS = gains_diagonal * general_para.tx_power / general_para.output_noise_power direct_rates = general_para.bandwidth * np.log2(1 + SNRS / general_para.SNR_gap) 94 sorted_links_indices = np.argsort(prop_weights * direct_rates, axis=1) allocs = np.zeros([n_layouts, N]) previous_weighted_sum_rates = np.zeros([n_layouts]) for j in range(N - 1, -1, -1): allocs[np.arange(n_layouts), sorted_links_indices[:, j]] = rates = helper_functions.compute_rates(general_para, allocs, gains_diagonal, gains_nondiagonal) weighted_sum_rates = np.sum(rates * prop_weights, axis=1) allocs[np.arange(n_layouts), sorted_links_indices[:, j]] = (weighted_sum_rates > previous_weighted_sum_rates).astype(int) previous_weighted_sum_rates = np.maximum(weighted_sum_rates, previous_weighted_sum_rates) return allocs """evaluate_sumrate.py""" # danh gia hieu suat toc tong import numpy as np import matplotlib.pyplot as plt import general_parameters import helper_functions import benchmarks import dnn_gli INCLUDE_FADING = False if name == ’ main ’: general_para = general_parameters.parameters() N = general_para.n_links print("Evaluate Setting: ", general_para.setting_str) 95 layouts = np.load("layouts_{}.npy".format(general_para.setting_str)) path_losses = np.load("path_losses_{}.npy".format(general_para.setting_str)) if INCLUDE_FADING: print("testing under CSI with fading") channel_losses = helper_functions.add_shadowing(path_losses) channel_losses = helper_functions.add_fast_fading(channel_losses) else: print("testing under CSI without fading") channel_losses = path_losses n_layouts = np.shape(layouts)[0] assert np.shape(layouts) == (n_layouts, N, 4) assert np.shape(channel_losses) == (n_layouts, N, N) directLink_channel_losses = helper_functions.get_directLink_channel_losses(channel_losses) crossLink_channel_losses = helper_functions.get_crossLink_channel_losses(channel_losses) allocs_all_methods = {} sum_rates_all_methods = {} allocs_all_methods["FP"] = benchmarks.FP(general_para, channel_losses, np.ones([n_layouts, N])) allocs_all_methods["dnn_gli"] = dnn_gli.scheduling(general_para, layouts) allocs_all_methods["Greedy"] = benchmarks.Greedy(general_para, directLink_channel_losses, crossLink_channel_losses, np.ones([n_layouts, N])) allocs_all_methods["Random"] = np.random.randint(2, size=[n_layouts, N]).astype(float) allocs_all_methods["All Active"] = np.ones([n_layouts, 96 N]).astype(float) print(">>>>>>>>>>EVALUATION

Ngày đăng: 28/07/2023, 12:33

Tài liệu cùng người dùng

Tài liệu liên quan