Searcharxiv⌕ Search

arXiv subjects

Johan Larsson

Publications and source records attributed to Johan Larsson.

At least 19 recordsLinked to original sources

Eunoia: Area-Proportional Euler and Venn Diagrams in Rust, Julia, Python, R, and JavaScript

Area-proportional Euler diagrams visualize sets and their intersections through regions whose areas represent their sizes. Because many set specifications have no exact geometric representation, constructing these diagrams requires numerical optimization and diagnostics that quantify the remaining discrepancies. Eunoia is a Rust library for fitting area-proportional Euler diagrams and constructing canonical Venn diagrams. It supports circles, ellipses, squares, and rectangles, computes region areas analytically, and provides exact analytical gradients for several shape families. Its fitting pipeline combines multidimensional scaling initialization with local refinement, global optimization when needed, and seeded restarts. Fitted layouts include residuals and goodness-of-fit statistics that help users assess how faithfully a diagram represents the data. Shared plotting routines extract region polygons, place labels, and pack unit glyphs and member names within regions. The same core implementation powers packages for R, Python, Julia, and JavaScript, a C interface, and a web application that fits diagrams entirely in the browser through WebAssembly. By centralizing fitting, geometry, diagnostics, and annotation in an independent library, Eunoia provides consistent set visualization across programming languages and interactive applications.

stat.CO↗

How to Train Your Intercept: A Comparison of Intercept Update Strategies in Coordinate Descent

Coordinate descent solvers for regularized generalized linear models (GLMs) differ in how they update the intercept. This seemingly routine choice can substantially affect convergence when the response is imbalanced. For direct coordinate descent on the original GLM loss, we compare a conservative step based on worst-case curvature, a safeguarded Newton step based on current curvature, and repeated Newton steps that solve the intercept subproblem. The conservative update can leave much of the interaction between the intercept and the coefficients unresolved, producing a slowdown when that interaction controls convergence. A single Newton step avoids this attenuation and, in our experiments, follows nearly the same outer trajectory as exact minimization while requiring fewer inner steps. Simulated and real-data experiments, including comparisons across six production solvers and a controlled intervention within skglm, support this explanation. We also show how the same mechanism appears in quadratic-approximation methods and extends to multinomial models with rare classes. We recommend a safeguarded Newton update for direct coordinate descent and full intercept optimization within frozen local quadratic surrogates.

stat.CO↗

Feature Normalization under Finite Training Budgets

Standardizing a rare feature can help stochastic gradient descent learn its effect within a finite budget, but it also changes the noise cost of learning. We characterize the lowest rare-subgroup risks attainable by standardized and unscaled training when each chooses a nonnegative constant learning rate and a deterministic stopping time under the same observation cap. For two independent binary features, we derive both optimized risks as prevalence vanishes while the expected number of rare observations remains finite. Uniform control over rates and stopping times reduces each limiting oracle to a scalar minimization. With positive noise, the preferred scaling changes exactly once as we move signal to the rare feature while the limiting risk at initialization stays fixed and positive. The formulas also explain how noise and budget affect the comparison. Separate finite-prevalence bounds favor standardization on a rare-dominant signal family and unscaled training on a common-dominant family. The results concern final iterates with population preprocessing and fresh observations. Exact-moment searches assess the approximation at finite prevalence. In a controlled study, both orderings persist under observation reuse, estimated preprocessing, and intercept fitting when tuning choices are fixed before evaluation. Selecting a predictor after observing training can reverse an ordering, even when selection uses exact population risk.

stat.ML↗

Efficient Solvers for SLOPE in R, Python, Julia, and C++

We present a suite of packages in R, Python, Julia, and C++ that efficiently solve the Sorted L-One Penalized Estimation (SLOPE) problem. The packages feature a highly efficient hybrid coordinate descent algorithm that fits generalized linear models (GLMs) and supports a variety of loss functions, including Gaussian, binomial, Poisson, and multinomial logistic regression. Our implementation is designed to be fast, memory-efficient, and flexible. The packages support a variety of data structures (dense, sparse, and out-of-memory matrices) and are designed to efficiently fit the full SLOPE path as well as handle cross-validation of SLOPE models, including the relaxed SLOPE. We present examples of how to use the packages and benchmarks that demonstrate the performance of the packages on both real and simulated data and show that our packages outperform existing implementations of SLOPE in terms of speed.

stat.CO↗

Basin: Efficient and Extensible Numerical Optimization in Rust

Basin is a numerical optimization library for the Rust programming language. Numerical optimization is the task of finding the inputs that minimize a function, and it is a fundamental element across the sciences: fitting a model to data, calibrating a simulation, training a machine learning model, or choosing engineering parameters that minimize cost. Basin gives users a single, consistent way to both state and solve such problems, with a broad catalog of solvers and first-class support for constraints.

cs.LG↗

Effects of mean flow skew on turbulent shear layers. Part I. Numerical investigation

Skewed turbulent shear layers, formed by the interaction between two non-aligned turbulent boundary layers, are investigated using high-fidelity large eddy simulations in a temporally evolving framework. It is argued that a skewed shear layer of this form should be viewed, in the long-time limit, in a rotated reference frame as the superposition of a standard planar shear layer and an orthogonal jet-like component that decays in time. The skewed shear layer is found to have reduced vertical integral length scale, and the coherent pressure rollers characteristic of shear layers undergo transient realignment towards the direction orthogonal to mean shear, consistent with the long-time limiting planar shear layer. Numerical experiments using fictitious test cases indicate that these effects are primarily driven through misalignment in the mean flow, and that the two orthogonal flow components in the mean shear frame are only weakly coupled.

physics.flu-dyn↗

Effects of mean flow skew on turbulent shear layers. Part II. Experimental investigation

Planar turbulent mixing layers, formed by the interactions of two parallel streams with different velocities, have been studied far more than three dimensional (3D) turbulent mixing layers, in which the incoming streams are skewed, and not parallel. Yet many practical shear flows are 3D. Here, we develop and validate an experimental methodology to generate and characterize skewed turbulent mixing layers and to quantify how mean-flow skew modifies mixing layer dynamics. We introduce skew with a spanwise deflection of the mean flow using turning vanes mounted near the trailing edge of a splitter plate, and we use cross-wire anemometry to investigate the downstream evolution of the flow. Relative to the planar configuration, the skewed mixing layer exhibits systematic reductions in both mean and turbulent quantities, with deviations reaching approximately 40\%. Despite these quantitative differences, the fundamental characteristics of the mixing layer remain largely unchanged. Mean-velocity profiles collapse under similarity scaling, shear-layer thicknesses retain approximately linear downstream growth, and Reynolds-stress profiles preserve their characteristic near-Gaussian form. Townsend's structure parameter, which quantifies the efficiency of turbulent momentum transport, remains approximately invariant between the planar and skewed configurations, in contrast to skewed turbulent boundary layers, wherein comparable mean flow skewing reduces the parameter by approximately 30\%. These results indicate that mean flow skew modifies turbulent mixing layers quantitatively while exerting only a secondary influence on their underlying dynamics. This study establishes a controlled experimental framework and empirical benchmark for future investigations of three-dimensional free-shear turbulence.

physics.flu-dyn↗

SmartFlow: A CFD-solver-agnostic deep reinforcement learning framework for computational fluid dynamics on HPC platforms

Deep reinforcement learning (DRL) is emerging as a powerful tool for fluid-dynamics research, encompassing active flow control, autonomous navigation, turbulence modeling and discovery of novel numerical schemes. We introduce SmartFlow, a CFD-solver-agnostic framework for both single- and multi-agent DRL algorithms that can easily integrate with MPI-parallel CPU and GPU-accelerated solvers. Built on Relexi and SmartSOD2D, SmartFlow uses the SmartSim infrastructure library and our newly developed SmartRedis-MPI library to enable asynchronous, low-latency, in-memory communication between CFD solvers and Python-based DRL algorithms. SmartFlow leverages PyTorch's Stable-Baselines3 for training, which provides a modular, Gym-like environment API. We demonstrate its versatility via three case studies: single-agent synthetic-jet control for drag reduction in a cylinder flow simulated by the high-order FLEXI solver, multi-agent cylinder wake control using the GPU-accelerated spectral-element code SOD2D, and multi-agent wall-model learning for large-eddy simulation with the finite-difference solver CaLES. SmartFlow's CFD-solver-agnostic design and seamless HPC integration is promising to accelerate RL-driven fluid-mechanics studies.

physics.flu-dyn↗

The Choice of Normalization Influences Shrinkage in Regularized Regression

Regularized models are often sensitive to the scales of the features in the data and it has therefore become standard practice to normalize (center and scale) the features before fitting the model. But there are many different ways to normalize the features and the choice may have dramatic effects on the resulting model. In spite of this, there has so far been no research on this topic. In this paper, we begin to bridge this knowledge gap by studying normalization in the context of lasso, ridge, and elastic net regression. We focus on binary features and show that their class balances (proportions of ones) directly influences the regression coefficients and that this effect depends on the combination of normalization and regularization methods used. We demonstrate that this effect can be mitigated by scaling binary features with their variance in the case of the lasso and standard deviation in the case of ridge regression, but that this comes at the cost of increased variance of the coefficient estimates. For the elastic net, we show that scaling the penalty weights, rather than the features, can achieve the same effect. Finally, we also tackle mixes of binary and normal features as well as interactions and provide some initial results on how to normalize features in these cases.

stat.ML↗

Scaling of wall pressure and the peak of streamwise turbulence intensity in compressible wall flows

This paper develops scaling laws for wall-pressure root-mean-square (r.m.s.) and the peak of streamwise turbulence intensity, accounting for both variable-property and intrinsic compressibility effects -- those associated with changes in fluid volume due to pressure variations. To develop such scaling laws, we express the target quantities as an expansion series in powers of an appropriately defined Mach number. The leading-order term is represented using the scaling relations developed for incompressible flows, but with an effective Reynolds number. Higher-order terms capture intrinsic compressibility effects and are modeled as constant coefficients, calibrated using flow cases specifically designed to isolate these effects. The resulting scaling relations are shown to be accurate for a wide range of turbulent channel flows and boundary layers.

physics.flu-dyn↗

CaLES: A GPU-accelerated solver for large-eddy simulation of wall-bounded flows

We introduce CaLES, a GPU-accelerated finite-difference solver designed for large-eddy simulations (LES) of incompressible wall-bounded flows in massively parallel environments. Built upon the existing direct numerical simulation (DNS) solver CaNS, CaLES relies on low-storage, third-order Runge-Kutta schemes for temporal discretization, with the option to treat viscous terms via an implicit Crank-Nicolson scheme in one or three directions. A fast direct solver, based on eigenfunction expansions, is used to solve the discretized Poisson/Helmholtz equations. For turbulence modeling, the classical Smagorinsky model with van Driest near-wall damping and the dynamic Smagorinsky model are implemented, along with a logarithmic law wall model. GPU acceleration is achieved through OpenACC directives, following CaNS-2.3.0. Performance assessments were conducted on the Leonardo cluster at CINECA, Italy. Each node is equipped with one Intel Xeon Platinum 8358 CPU (2.60 GHz, 32 cores) and four NVIDIA A100 GPUs (64 GB HBM2e), interconnected via NVLink 3.0 (200 GB/s). The inter-node communication bandwidth is 25 GB/s, supported by a DragonFly+ network architecture with NVIDIA Mellanox InfiniBand HDR. Results indicate that the computational speed on a single GPU is equivalent to approximately 15 CPU nodes, depending on the treatment of viscous terms and the subgrid-scale model, and that the solver efficiently scales across multiple GPUs. The predictive capability of CaLES has been tested using multiple flow cases, including decaying isotropic turbulence, turbulent channel flow, and turbulent duct flow. The high computational efficiency of the solver enables grid convergence studies on extremely fine grids, pinpointing non-monotonic grid convergence for wall-modeled LES.

physics.flu-dyn↗

Intrinsic compressibility effects in near-wall turbulence

The impact of intrinsic compressibility effects -- changes in fluid volume due to pressure variations -- on high-speed wall-bounded turbulence has often been overlooked or incorrectly attributed to mean property variations. To unambiguously quantify these intrinsic compressibility effects, we perform direct numerical simulations of compressible turbulent channel flows with nearly uniform mean properties. Our simulations reveal that intrinsic compressibility effects yield a significant upward shift in the logarithmic mean velocity profile that can be attributed to the reduction in the turbulent shear stress. This reduction stems from the weakening of the near-wall quasi-streamwise vortices. We in turn attribute this weakening to the spontaneous opposition of sweeps and ejections from the near-wall expansions and contractions of the fluid, and provide a theoretical explanation for this mechanism. Our results also demonstrate that intrinsic compressibility effects are responsible for the increase in the inner-scaled streamwise turbulence intensity in compressible flows compared to incompressible flows, previously regarded to be an effect of mean property variations.

physics.flu-dyn↗

Incorporating intrinsic compressibility effects in velocity transformations for wall-bounded turbulent flows

A transformation that relates a compressible wall-bounded turbulent flow with non-uniform fluid properties to an equivalent incompressible flow with uniform fluid properties is derived and validated. The transformation accounts for both variable-property and intrinsic compressibility effects, the latter being the key improvement over the current state-of-the-art. The importance of intrinsic compressibility effects contradicts the renowned Morkovin's hypothesis.

physics.flu-dyn↗

Estimating mean profiles and fluxes in high-speed turbulent boundary layers using inner/outer-layer transformations

Accurately predicting drag and heat transfer for compressible high-speed flows is of utmost importance for a range of engineering applications. This requires the precise knowledge of the entire velocity and temperature profiles. A common approach is to use compressible velocity scaling laws (transformation), that inverse transform the velocity profile of an incompressible flow, together with a temperature-velocity relation. In this Note, we use distinct velocity transformations for the inner and outer layers. In the inner layer, we utilize a recently proposed scaling law that appropriately incorporates variable property and intrinsic compressibility effects, while the outer layer profile is inverse-transformed with the well-known Van Driest transformation. The result is an analytical expression for the mean shear valid in the entire boundary layer, which combined with a temperature-velocity relationship, provides predictions of mean velocity and temperature profiles at unprecedented accuracy. Using these profiles, drag and heat transfer is evaluated with an accuracy of +/-4% and +/-8%, respectively, for a wide range of compressible turbulent boundary layers up to Mach numbers of 14.

physics.flu-dyn↗

Grid-Adaptation for Wall-Modeled Large Eddy Simulation Using Unstructured High-Order Methods

The accuracy and computational cost of a large eddy simulation are highly dependent on the computational grid. Building optimal grids manually from a priori knowledge is not feasible in most practical use cases; instead, solution-adaptive strategies can provide a robust and cost-efficient method to generate a grid with the desired accuracy. We adapt the grid-adaptation algorithm developed by Toosi and Larsson to a Discontinuous Galerkin Spectral Elements Method (DGSEM) and show its potential on fully unstructured grids. The core of the method is the computation of the estimated modeling residual using the polynomial basis functions used in DGSEM, and the averaging of the estimated residual over each element. The final method is assessed in multiple channel flow test cases and for the transonic flow over an airfoil, in both cases making use of mortar interfaces between elements with hanging nodes. The method is found to be robust and reliable, and to provide solutions at up to 50% lower cost at comparable accuracy compared to when using human-generated grids.

physics.flu-dyn↗

Benchopt: Reproducible, efficient and collaborative optimization benchmarks

Numerical validation is at the core of machine learning research as it allows to assess the actual impact of new methods, and to confirm the agreement between theory and practice. Yet, the rapid development of the field poses several challenges: researchers are confronted with a profusion of methods to compare, limited transparency and consensus on best practices, as well as tedious re-implementation work. As a result, validation is often very partial, which can lead to wrong conclusions that slow down the progress of research. We propose Benchopt, a collaborative framework to automate, reproduce and publish optimization benchmarks in machine learning across programming languages and hardware architectures. Benchopt simplifies benchmarking for the community by providing an off-the-shelf tool for running, sharing and extending experiments. To demonstrate its broad usability, we showcase benchmarks on three standard learning tasks: $\ell_2$-regularized logistic regression, Lasso, and ResNet18 training for image classification. These benchmarks highlight key practical findings that give a more nuanced view of the state-of-the-art for these problems, showing that for practical evaluation, the devil is in the details. We hope that Benchopt will foster collaborative work in the community hence improving the reproducibility of research findings.

cs.LG↗

Coordinate Descent for SLOPE

The lasso is the most famous sparse regression and feature selection method. One reason for its popularity is the speed at which the underlying optimization problem can be solved. Sorted L-One Penalized Estimation (SLOPE) is a generalization of the lasso with appealing statistical properties. In spite of this, the method has not yet reached widespread interest. A major reason for this is that current software packages that fit SLOPE rely on algorithms that perform poorly in high dimensions. To tackle this issue, we propose a new fast algorithm to solve the SLOPE optimization problem, which combines proximal gradient descent and proximal coordinate descent steps. We provide new results on the directional derivative of the SLOPE penalty and its related SLOPE thresholding operator, as well as provide convergence guarantees for our proposed solver. In extensive benchmarks on simulated and real data, we show that our method outperforms a long list of competing algorithms.

math.OC↗

The Hessian Screening Rule

Predictor screening rules, which discard predictors before fitting a model, have had considerable impact on the speed with which sparse regression problems, such as the lasso, can be solved. In this paper we present a new screening rule for solving the lasso path: the Hessian Screening Rule. The rule uses second-order information from the model to provide both effective screening, particularly in the case of high correlation, as well as accurate warm starts. The proposed rule outperforms all alternatives we study on simulated data sets with both low and high correlation for $\ell_1$-regularized least-squares (the lasso) and logistic regression. It also performs best in general on the real data sets that we examine.

stat.ML↗