In recent years, Python has become widely used language for data processing in machine learning and deep learning. However, the dynamic typing of Python can lead to errors caused by arrayshape mismatches that are onl...
详细信息
In recent years, Python has become widely used language for data processing in machine learning and deep learning. However, the dynamic typing of Python can lead to errors caused by arrayshape mismatches that are only detected at runtime. To increase development efficiency, we propose a static method to check Python code that can detect shapeerrors before execution. Existing research activities such as Pytropos provide the capability to manually annotate the shape types of arrays and external datasets with Python's type hint feature. However, manual annotation decreases code flexibility and can cause problems, such as incorrect marking due to human error, and wasted labor and time costs. To address these issues, we propose a method that leverages abstract interpretation and abstract syntax tree analysis to statically check code for array and dataset shape types, thus reducing the need for manual annotation and improving code flexibility. We give an implementation of the proposed method named shapeChecker for the widely-used library NumPy as an example. shapeChecker extracts the shape type of NumPy arrays and automatically reads external datasets to obtain shape type information, accelerating the checking process and outputting the cause of shapeerrors when detected. We compared shapeChecker with existing solutions in various scenarios and obtained promising results, demonstrating the tool's usefulness in improving efficiency and reducing runtime errors. To further enhance its functionality, we plan to extend shapeChecker's support to more packages and address known issues. Overall, our proposed method and shapeChecker tool provide a static approach to detecting array shape errors that can improve code quality and improve development efficiency.
Calibration of array shape error is a key issue for most existing source localisation algorithms. In this study, the far-field self-calibration and near-field pilot-calibration are carried out using unconditional maxi...
详细信息
Calibration of array shape error is a key issue for most existing source localisation algorithms. In this study, the far-field self-calibration and near-field pilot-calibration are carried out using unconditional maximum likelihood (UML) estimator whose objective function is optimised by particle swarm optimisation (PSO). A new technique, decaying diagonal loading (DDL), is proposed to enhance the performance of PSO at high signal-to-noise ratio (SNR) by dynamically lowering it, based on the counter-intuitive observation that the global optimum of the UML objective function is more prominent at lower SNR. Numerical simulations demonstrate that the UML estimator optimised by PSO with DDL is robust to large shapeerrors, optimally accurate and free of the initialisation problem. In addition, the DDL technique can be coupled with different global optimisation algorithms for performance enhancement. Mathematical analysis indicates that the DDL is applicable to any array processing problem where the UML estimator is employed.
暂无评论