| NumPy's API and array protocols expose new arrays to the ecosystem. In this example, NumPy's 'mean' function is called on a Dask array. The call succeeds by dispatching to the appropriate library implementation (in this case, Dask) and results in a new Dask array. Compare this code to the example code in Fig. 1g.

| NumPy's API and array protocols expose new arrays to the ecosystem. In this example, NumPy's 'mean' function is called on a Dask array. The call succeeds by dispatching to the appropriate library implementation (in this case, Dask) and results in a new Dask array. Compare this code to the example code in Fig. 1g.

Source publication
Article
Full-text available
Array programming provides a powerful, compact and expressive syntax for accessing, manipulating and operating on data in vectors, matrices and higher-dimensional arrays. NumPy is the primary array programming library for the Python language. It has an essential role in research analysis pipelines in fields as diverse as physics, chemistry, astrono...

Contexts in source publication

Context 1
... NumPy has developed a culture of using time-tested software engineering practices to improve collaboration and reduce error 30 . This culture is not only adopted by leaders in the project but also enthusiastically taught to newcomers. The NumPy team was early to adopt distributed revision control and code review to improve collaboration (Fig. ...
Context 2
... facilitate this interoperability, NumPy provides 'protocols' (or contracts of operation), that allow for specialized arrays to be passed to NumPy functions (Fig. 3). NumPy, in turn, dispatches operations to the originating library, as required. Over four hundred of the most popular NumPy functions are supported. The protocols are implemented by widely used libraries such as Dask, CuPy, xarray and PyData/Sparse. Thanks to these developments, users can now, for example, scale their computation from ...

Citations

... For all experiments we relied heavily on NumPy [71] and SciPy [72]. To obtain samples from the weight posterior we use Hamiltonian Monte Carlo with the no-u-turn sampler (see, e.g., [73,74]) implemented in numpyro [75,76] with jax [77] as a back-end; the model itself is implemented using the front-end provided by pymc [78]. ...
Preprint
    Neural networks posses the crucial ability to generate meaningful representations of task-dependent features. Indeed, with appropriate scaling, supervised learning in neural networks can result in strong, task-dependent feature learning. However, the nature of the emergent representations, which we call the `coding scheme', is still unclear. To understand the emergent coding scheme, we investigate fully-connected, wide neural networks learning classification tasks using the Bayesian framework where learning shapes the posterior distribution of the network weights. Consistent with previous findings, our analysis of the feature learning regime (also known as `non-lazy', `rich', or `mean-field' regime) shows that the networks acquire strong, data-dependent features. Surprisingly, the nature of the internal representations depends crucially on the neuronal nonlinearity. In linear networks, an analog coding scheme of the task emerges. Despite the strong representations, the mean predictor is identical to the lazy case. In nonlinear networks, spontaneous symmetry breaking leads to either redundant or sparse coding schemes. Our findings highlight how network properties such as scaling of weights and neuronal nonlinearity can profoundly influence the emergent representations.
    ... ODEs executed in COPASI were specified using generated SBML from Antimony specification. Parameter sampling for ODE simulation with libRoadRunner was performed using methods provided in SciPy v1.11.3 (Virtanen et al., 2020). The GSW ABM NetLogo implementation was executed in NetLogo v6. ...
    Preprint
    Full-text available
      Reproducibility is a foundational standard for validating scientific claims in computational research. Stochastic computational models are employed across diverse fields such as systems biology, financial modelling and environmental sciences. Existing infrastructure and software tools support various aspects of reproducible model development, application, and dissemination, but do not adequately address independently reproducing simulation results that form the basis of scientific conclusions. To bridge this gap, we introduce the Empirical Characteristic Function Equality Convergence Test (EFECT), a data-driven method to quantify the reproducibility of stochastic simulation results. EFECT employs empirical characteristic functions to compare reported results with those independently generated by assessing distributional inequality, termed EFECT error, a metric to quantify the likelihood of equality. Additionally, we establish the EFECT convergence point, a metric for determining the required number of simulation runs to achieve an EFECT error value of a priori statistical significance, setting a reproducibility benchmark. EFECT supports all real-valued and bounded results irrespective of the model or method that produced them, and accommodates stochasticity from intrinsic model variability and random sampling of model inputs. We tested EFECT with stochastic differential equations, agent-based models, and Boolean networks, demonstrating its broad applicability and effectiveness. EFECT standardizes stochastic simulation reproducibility, establishing a workflow that guarantees reliable results, supporting a wide range of stakeholders, and thereby enhancing validation of stochastic simulation studies, across a model's lifecycle. To promote future standardization efforts, we are developing open source software library libSSR in diverse programming languages for easy integration of EFECT.
      ... Our experiments were carried out using PyTorch [58] and the TransformersLens library [52]. We performed our data analysis using NumPy [30] and Pandas [77]. Our figures were made using Plotly [60]. ...
      Preprint
      Full-text available
        Despite their widespread use, the mechanisms by which large language models (LLMs) represent and regulate uncertainty in next-token predictions remain largely unexplored. This study investigates two critical components believed to influence this uncertainty: the recently discovered entropy neurons and a new set of components that we term token frequency neurons. Entropy neurons are characterized by an unusually high weight norm and influence the final layer normalization (LayerNorm) scale to effectively scale down the logits. Our work shows that entropy neurons operate by writing onto an unembedding null space, allowing them to impact the residual stream norm with minimal direct effect on the logits themselves. We observe the presence of entropy neurons across a range of models, up to 7 billion parameters. On the other hand, token frequency neurons, which we discover and describe here for the first time, boost or suppress each token's logit proportionally to its log frequency, thereby shifting the output distribution towards or away from the unigram distribution. Finally, we present a detailed case study where entropy neurons actively manage confidence in the setting of induction, i.e. detecting and continuing repeated subsequences.
        ... To process all analysis, there were several Python and machine learning libraries which needed to be declared in beginning of the code. In general, libraries like Sklearn, NumPy, Pandas, and Matplotlib were declared in the first step [48][49][50][51]. ...
        Article
        Full-text available
        Perception is essential for robotic systems, enabling effective interaction with their surroundings through actions such as grasping and touching. Traditionally, this has relied on integrating various sensor systems, including tactile sensors, cameras, and acoustic sensors. This study leverages commercially available tactile sensors for hardness classification, drawing inspiration from the functionality of human mechanoreceptors in recognizing complex object properties during grasping tasks. Unlike previous research using customized sensors, this study focuses on cost-effective , easy-to-install, and readily deployable sensors. The approach employs a qualitative method, using Shore hardness taxonomy to select objects and evaluate the performance of commercial off-the-shelf (COTS) sensors. The analysis includes data from both individual sensors and their combinations analysed using multiple machine learning approaches, and accuracy as the primary evaluation metric was considered. The findings illustrate that increasing the number of classification classes impacts accuracy, achieving 92% in binary classification, 82% in ternary, and 80% in quaternary scenarios. Notably, the performance of commercially available tactile sensors is comparable to those reported in the literature, which range from 50% to 98% accuracy, achieving 92% accuracy with a limited data set. These results highlight the capability of COTS tactile sensors in hardness classification giving accuracy levels of 92%, while being cost-effective and easier to deploy than customized tactile sensors.
        ... To the best of our knowledge, our implementation is the first open-source toolkit for simulating quantum homomorphic encryption. Our software implementation relies heavily on the NumPy library [15]. For the HE component of our implementation, we selected a Python implementation of the Brakerski-Fan-Vercauteren (BFV) levelled classical homomorphic encryption scheme in [16], that is based on the works [17], [18]. ...
        Preprint
        Full-text available
          Quantum homomorphic encryption (QHE), allows a quantum cloud server to compute on private data as uploaded by a client. We provide a proof-of-concept software simulation for QHE, according to the "EPR" scheme of Broadbent and Jeffery, for universal quantum circuits. We demonstrate the near-term viability of this scheme and provide verification that the additional cost of homomorphic circuit evaluation is minor when compared to the simulation cost of the quantum operations. Our simulation toolkit is an open-source Python implementation, that serves as a step towards further hardware applications of quantum homomorphic encryption between networked quantum devices.
          ... equation, V box denotes the total volume of the simulation box, andĨ represents the Fourier transform of the simulated line intensity projected onto a 3D grid cell (voxel), I cell . To calculatẽ I , we utilize the NumPy FFT module(Harris et al. 2020).The intensity of each grid cell can be written as(Dumitru et al. 2019) V cell represents the volume of the cell. Similarly, we calculate the cross-power spectrum from the simulation box using the equation(Dumitru et al. 2019) ...
          Article
          Full-text available
          Line intensity mapping (LIM) serves as a potent probe in astrophysics, relying on the statistical analysis of integrated spectral line emissions originating from distant star-forming galaxies. While LIM observations hold the promise of achieving a broad spectrum of scientific objectives, a significant hurdle for future experiments lies in distinguishing the targeted spectral line emitted at a specific redshift from undesired line emissions originating at different redshifts. The presence of these interloping lines poses a challenge to the accuracy of cosmological analyses. In this study, we introduce a novel approach to quantify line–line cross-correlations (LIM-LLX), enabling us to investigate the target signal amid instrumental noise and interloping emissions. For example, at a redshift of z ∼ 3.7, we observed that the measured auto-power spectrum of C ii 158 exhibited substantial bias, from interloping line emission. However, cross-correlating C ii 158 with CO(6–5) lines using an FYST-like experiment yielded a promising result, with a signal-to-noise ratio of ∼10. This measurement is notably unbiased. Additionally, we explore the extensive capabilities of cross-correlation by leveraging various CO transitions to probe the tomographic Universe at lower redshifts through LIM-LLX. We further demonstrate that incorporating low-frequency channels, such as 90 and 150 GHz, into FYST’s EoR-Spec-like experiment can maximize the potential for cross-correlation studies, effectively reducing the bias introduced by instrumental noise and interlopers.
          ... Chroma [79], QPhiX [58], and GLU [57] were instrumental in the calculations of this work, with CPS [80], Grid [81], and QLua [82] playing important roles during code development. Wolfram Mathematica [83], NumPy [84,85], SciPy [86], GVAR [87], LSQFIT [88], and PANDAS [89,90] were used for data analysis. Figures were produced using Matplotib and SEABORN [91,92]. ...
          Article
          Full-text available
          Neutrinoless double-beta ( 0 ν β β ) decay is a heretofore unobserved process which, if observed, would imply that neutrinos are Majorana particles. Interpretations of the stringent experimental constraints on 0 ν β β -decay half-lives require calculations of nuclear matrix elements. This work presents the first lattice quantum chromodynamics (LQCD) calculation of the matrix element for 0 ν β β decay in a multinucleon system, specifically the n n → p p e e transition, mediated by a light left-handed Majorana neutrino propagating over nuclear-scale distances. This calculation is performed with quark masses corresponding to a pion mass of m π = 806 MeV at a single lattice spacing and volume. The statistically cleaner Σ − → Σ + e e transition is also computed in order to investigate various systematic uncertainties. The prospects for matching the results of LQCD calculations onto a nuclear effective field theory to determine a leading-order low-energy constant relevant for 0 ν β β decay with a light Majorana neutrino are investigated. This work, therefore, sets the stage for future calculations at physical values of the quark masses that, combined with effective field theory and nuclear many-body studies, will provide controlled theoretical inputs to experimental searches of 0 ν β β decay. Published by the American Physical Society 2024
          ... The included screenshots were created using the Open3D [26] library for illustrative purposes. All calculations in the work were vectorized using NumPy [41] and SciPy [42] and processed in tabular form using pandas [43]. ...
          Preprint
          Full-text available
          Skilled labor shortages and the growing trend for customized products are increasing the complexity of manufacturing systems. Automation is often proposed to address these challenges, but industries operating under the engineer-to-order, lot-size-one production model often face significant limitations due to the lack of relevant data. This study investigates a laser-based optical worker assistance system in control cabinet manufacturing to demonstrate how geometric deep learning can enable the digitization and automation of complex manufacturing processes. An approach is presented for the extraction of assembly-relevant information, using only vendor-independent STEP files, and the integration and validation of these information in an industrial use case. This approach improves data quality and facilitates data transferability to components not listed in leading ECAD databases, suggesting broader potential for generalization across different components and use cases. In addition, an end-to-end inference pipeline without proprietary formats ensures high data integrity while approximating the surface of the underlying topology, making it suitable for small and medium-sized companies with limited computing resources. The study not only achieves the accuracy required for full automation, but also introduces the Spherical Boundary Score (SBS), a metric for evaluating the quality of assembly-relevant information and its application in real-world scenarios. Highlights-Assembly-relevant information can be extracted from digital representations-Neural network predictions enable better results than information from manufacturer-Assessment of three different mathematical approaches for feature detection-Evaluation of metrics to measure the quality of the detected assembly information-Application of Spherical Boundary Score in an industrial information use case
          ... Most of the CBXPy implementation uses basic Python functionality, and the agents are handled as an array-like structure. For certain specific features, like broadcasting-behaviour, array copying, and index selection, we fall back to the numpy implementation (Harris et al., 2020 ConsensusBasedX.jl has been almost entirely written in native Julia (with the exception of a single call to LAPACK). ...
          ... DICOM files were loaded using pydicom, and then converted to NIfTI format using dcm2niix (Li et al., 2016). NiBabel and numpy (Harris et al., 2020) were used to load and manipulate NIfTI files, and Project MONAI (Cardoso et al., 2022) was used to resample, resize, and normalise each image. ...