FullStokes polarimetric datasets originating from slitspectrograph or narrowband filtergrams are routinely acquired nowadays. The data rate is increasing with the advent of bidimensional spectropolarimeters and observing techniques that allow longtime sequences of highquality observations. There is a clear need to go beyond the traditional pixelbypixel strategy in spectropolarimetric inversions by exploiting the spatiotemporal coherence of the inferred physical quantities. We explore the potential of neural networks as a continuous representation of the physical quantities over time and space also known as neural fields for spectropolarimetric inversions. We have implemented and tested a neural field to perform the inference of the magnetic field vector approach also known as physicsinformed neural networks under the weakfield approximation WFA. By using a neural field to describe the magnetic field vector we can regularize the solution in the spatial and temporal domain by assuming that the physical quantities are continuous functions of the coordinates. We investigated the results in synthetic and real observations of the Ca II 8542 A line. We also explored the impact of other explicit regularizations such as using the information of an extrapolated magnetic field or the orientation of the chromospheric fibrils. Compared to the traditional pixelbypixel inversion the neural field approach improves the fidelity of the reconstruction of the magnetic field vector especially the transverse component. This implicit regularization is a way of increasing the effective signaltonoise of the observations. Although it is slower than the pixelwise WFA estimation this approach shows a promising potential for depthstratified inversions by reducing the number of free parameters and inducing spatiotemporal constraints in the solution.
['Astrophysics - Solar and Stellar Astrophysics', 'Astrophysics - Instrumentation and Methods for Astrophysics']
Exploring spectropolarimetric inversions using neural fields. Solar chromospheric magnetic field under the weakfield approximation
{'Solar chromospheric magnetic field under the weak-field approximation': 'C. J. Díaz Baso 1 , 2 , A. Asensio Ramos 3 , 4 , J. de la Cruz Rodríguez 5 , J. M. da Silva Santos 6 , and L. Rouppe van der Voort 1 , 2  \n- 1 Institute of Theoretical Astrophysics, University of Oslo, P.O. Box 1029 Blindern, N-0315 Oslo, Norway\n- 2 Rosseland Centre for Solar Physics, University of Oslo, P.O. Box 1029 Blindern, N-0315 Oslo, Norway\n- 3 Instituto de Astrofísica de Canarias, C / Vía Láctea s / n, E-38205 La Laguna, Tenerife, Spain\n- 4 Departamento de Astrofísica, Universidad de La Laguna, E-38206 La Laguna, Tenerife, Spain\n- 5 Institute for Solar Physics, Dept. of Astronomy, Stockholm University, AlbaNova University Centre, SE-10691 Stockholm, Sweden\n- 6 National Solar Observatory, 3665 Discovery Drive, Boulder, CO 80303, USA  \ne-mail:  \ncarlos.diaz@astro.uio.no  \nDraft: compiled on September 10, 2024 at 12:51am UT', 'ABSTRACT': 'Context. Full-Stokes polarimetric datasets, originating from slit-spectrograph or narrow-band filtergrams, are routinely acquired nowadays. The data rate is increasing with the advent of bi-dimensional spectropolarimeters and observing techniques that allow long-time sequences of high-quality observations. There is a clear need to go beyond the traditional pixel-by-pixel strategy in spectropolarimetric inversions by exploiting the spatiotemporal coherence of the inferred physical quantities that contain valuable information about the conditions of the solar atmosphere.  \nAims. We explore the potential of neural networks as a continuous representation of the physical quantities over time and space (also known as neural fields), for spectropolarimetric inversions.  \nMethods. We have implemented and tested a neural field to perform one of the simplest forms of spectropolarimetric inversions, the inference of the magnetic field vector under the weak-field approximation (WFA). By using a neural field to describe the magnetic field vector, we can regularize the solution in the spatial and temporal domain by assuming that the physical quantities are continuous functions of the coordinates. This technique can be trivially generalized to account for more complex inversion methods.  \nResults. We have tested the performance of the neural field to describe the magnetic field of a realistic 3D magnetohydrodynamic (MHD) simulation. We have also tested the neural field as a magnetic field inference tool (approach also known as physics-informed neural networks) using the WFA as our radiative transfer model. We investigated the results in synthetic and real observations of the Ca i i 8542Å line. We also explored the impact of other explicit regularizations, such as using the information of an extrapolated magnetic field, or the orientation of the chromospheric fibrils.  \nConclusions. Compared to the traditional pixel-by-pixel inversion, the neural field approach improves the fidelity of the reconstruction of the magnetic field vector, especially the transverse component. This implicit regularization is a way of increasing the e ff ective signal-to-noise of the observations. Although it is slower than the pixel-wise WFA estimation, this approach shows a promising potential for depth-stratified inversions, by reducing the number of free parameters and inducing spatio-temporal constraints in the solution.  \nKey words. Sun: atmosphere - Sun: chromosphere - Sun: magnetic fields - Methods: observational - Sun: activity - Radiative transfer', '1. Introduction': "During the past thirty years, inversion methods have proven to be one of the most robust ways of establishing a quantitative relation between the observed intensities and the underlying physical state of the atmospheric plasma. With the use of fast slit spectropolarimeters and 2D filterpolarimeters, maps of di ff erent regions in the solar atmosphere are routinely taken in which the four Stokes parameters are observed at several points along one or several spectral lines. The rate of new high-quality 2D observations is increasing with the advent of bi-dimensional spectropolarimeters and observing techniques that allow long time sequences of high-quality observations (Dominguez-Tagle et al. 2022; van Noort et al. 2022). With some exceptions (discussed below), in the overwhelming majority of studies available in the literature, such observations have been interpreted by assuming that all pixels are completely unrelated and by applying the inference  \ntechniques (commonly known as inversion codes) on a pixel-bypixel basis. However, the spatial complexity of the observations is not as chaotic as one would expect from the high dimensionality of the data (spatial, temporal, spectral), but is rather coherent as a consequence of the physical processes that dominate the solar dynamics.  \nFor example, the magnetic field in the chromosphere, where the magnetic pressure is larger than the gas pressure, tends to be rather smooth and slow-varying over space. However, polarimetric signals induced by those chromospheric magnetic fields are particularly weak, and in most cases very close to the detection limit of current instrumentation (e.g., Díaz Baso et al. 2019b; Yadav et al. 2021). Given these inherent properties, incorporating these characteristics in the inference would significantly help to constrain better the solar atmosphere.  \nThis spectral and spatial coherence has been exploited to e ff ectively reduce the noise in solar and stellar spectropolarimetric observations (Martínez González et al. 2008; Díaz Baso et al. 2019a) and avoid averaging in time or space, which could lead to a loss of important information. The new generation of inversion codes is also starting to make use of this coherency to improve the fidelity of their algorithms. A study by van Noort (2012) proposed to couple the solution of neighboring pixels using the telescope point spread function. This inspired the recent development of a non-linear spatially-regularized and multi-resolution inversion technique by de la Cruz Rodríguez (2019).  \nA di ff erent approach to take into account spatial coherency was presented by Asensio Ramos & de la Cruz Rodríguez (2015), using the concept of sparsity and compressibility, by linearly transforming the physical parameters to a di ff erent space in which their representation is compact. They used proximal algorithms (Parikh & Boyd 2014) to impose sparsity in the wavelet domain, decreasing the number of free parameters to reproduce the observables while simultaneously favoring spatial coherency. Recent studies (de la Cruz Rodríguez 2019, Morosin et al. 2020, de la Cruz Rodríguez & Leenaarts 2024) proposed adding spatiotemporal constraints by explicitly imposing a Tikhonov regularization on the physical parameters, thereby improving the fidelity of the reconstruction. At the same time, advances in deep learning have introduced the potential for data-driven regularizations. These methods encode complex priors from simulations into neural networks (Asensio Ramos & Pallé 2021; Liaudat et al. 2023). The ideas developed in the context of deep learning have also inspired other works, such as (Štˇepán et al. 2022, 2024), which propose to solve the 3D inversion problem by including the 3D non-local thermodynamic equilibrium consistency as a regularization, together with additional physical constraints and stochastic gradient descent techniques to mitigate issues of local minima. Lastly, automatic di ff erentiation frameworks, such as PyTorch (Paszke et al. 2019), facilitate the implementation of these ideas by e ffi ciently computing gradients and optimizing models to reproduce observations (De Ceuster et al. 2024).  \nMotivated by the development of new instruments with an increasing field of view, we believe that implicit methods that describe the physical parameters in the whole domain with a compact representation can be of great help to reduce the dimensionality of the problem and, consequently, the computational load of the inference process. Here we investigate a di ff erent way of parametrizing the physical quantities by using a neural network as a continuous approximation to introduce spatio-temporal constraints. Recent works have demonstrated the potential of this idea in coronal tomography (Asensio Ramos 2023), source reconstruction under strong gravitational lenses (Mishra-Sharma & Yang 2022), magnetic field extrapolations (Jarolim et al. 2024) and interstellar chemistry (Asensio Ramos et al. 2024). These neural networks, usually termed implicit neural representations, neural fields (NF), or coordinate-based representations, are used to map coordinates on the space (or space-time) to coordinate-dependent field quantities. They have many desirable properties: they are e ffi cient in terms of the number of free parameters, they have controllable implicit bias, they produce di ff erentiable quantities that can be part of more elaborate optimizations, and they generate continuous signals that are ideal for imposing spatio-temporal constraints in noisy scenarios. In this work, we will study the case where the magnetic field is inferred under the weak-field approximation (WFA; Landi Degl'Innocenti & Landi Degl'Innocenti 1973), a powerful method to estimate the magnetic field from plage (da Silva Santos et al. 2023) to flare scenarios (Vissers et al. 2021) and simple enough to focus our attention on this particular  \nnew implementation. The formalism also remains identical for LTE or non-LTE inversions of chromospheric lines. We plan to extend the use of NFs to more complex radiative transfer models in the near future.  \nThe paper is organized as follows. We start with a brief introduction to their basic principles, and how we implement the new approach to perform spectropolarimetric inversions. Later we show the application of the NF on some examples and introduce some additional explicit regularizations. Finally, we provide a brief discussion about the implications of this work and outline potential extensions and improvements.", '2.1. Weak-field approximation': "The weak-field approximation (WFA; Landi Degl'Innocenti & Landi Degl'Innocenti 1973) is an analytical solution of the radiative transfer equation. This allows us to derive the emerging Stokes Q , U , and V parameters describing the polarization of the light as a function of Stokes I and its derivatives as a function of wavelength. The fundamental assumptions are that the magnetic field vector is constant with depth and that the splitting induced by the Zeeman e ff ect ( ∆ λ B ) is significantly smaller than the Doppler width of the line ( ∆ λ D ). This weak field regime occurs at di ff erent field strengths for di ff erent spectral lines (depending on the sensitivity to the magnetic field, the local temperature, etc).  \nAt first order in the magnetic field strength, the relation between Stokes V and Stokes I is given by the following expression:  \nV ( λ ) = -∆ λ B ¯ g cos Θ B dI d λ (1)  \nwhere ∆ λ B = 4 . 6686 · 10 -13 λ 2 0 B , Θ B is the inclination of the magnetic field (angle between the observer's line-of-sight and the normal to the solar surface) and ¯ g is the Landé factor (Landi Degl'Innocenti & Landolfi 2004). The central wavelength of the line, λ 0, is given in Å while the magnetic field strength, B , is given in G. The same perturbation analysis allows obtaining Stokes Q and U , which only appear at second-order. In particular, we will use the equations that describe the dependence of Stokes Q and U in the wings ( λ ≫ ∆ λ D ) of the line:  \nQ ( λ w ) = 3 4 ∆ λ 2 B ¯ G sin 2 Θ B cos 2 Φ B 1 λ w -λ 0 GLYPH<18> dI d λ GLYPH<19> U ( λ w ) = 3 4 ∆ λ 2 B ¯ G sin 2 Θ B sin 2 Φ B 1 λ w -λ 0 GLYPH<18> dI d λ GLYPH<19> (2)  \nwhere ¯ G is a parameter that gives the magnetic sensitivity of linear polarization to B ⊥ , which depends on the quantum numbers of the transition (Landi Degl'Innocenti & Landolfi 2004). In both equations, there is a term depending on Φ B , which is the azimuth angle of the magnetic field with respect to a reference direction.", '2.2. Magnetic field inference': 'Once the model is set, we aim to infer the magnetic field vector from the interpretation of the observations of a set of spectral lines. Assuming that the weak-field approximation can be applied to the observed spectral lines and that observations are corrupted with uncorrelated Gaussian noise, we can use a least-squares estimator (maximum likelihood) to retrieve the magnetic field vector. The merit function L , the well-known χ 2 , can be defined for a particular pixel as the mean squared di ff erence of the observed  \nFig. 1: Sketch of the NF approach. The physical quantities are described by a neural network that takes the coordinates as input and outputs the physical quantities at that point ( x , y ). The output of the network is then used to compute the observables from the model using a radiative transfer (RT) module (WFA in this case). The synthetic observables are compared with the observations and the error is back-propagated through the network to obtain the optimal solution.  \n<!-- image -->  \npolarization signals and the synthetic ones predicted by the model, normalized by the variance of the noise:  \nL = L V + L Q + L U , (3)  \nwhere  \nL V = X i ( V obs i -V syn i ) σ 2 V , i , L Q = X i ( Q obs i -Q syn i ) σ 2 Q , i , L U = X i ( U obs i -U syn i ) σ 2 U , i . (4)  \nThe sub-index i is used as a label for the spectral wavelength points. The previous merit function considers the general case in which the standard deviation is di ff erent for Stokes Q , U , and V . The formal simplicity of Eqs. (1) and (2) is one of the most important reasons why WFA has been useful. This linear dependence on the model parameters allows for an analytical optimization of the χ 2 (see, e.g., Martínez González et al. 2012). Since our approach here is more general (taking spatial correlation into account and considering more complex radiative transfer models in the near future), we do not use the analytical optimization of the χ 2 . Rather, we consider the numerical optimization of the χ 2 using gradient-based methods.  \nFrom a practical point of view, using B , Θ B , and Φ B as free variables often leads to problems in the optimization. They are subject to several physical restrictions like the positive definiteness of B or are plagued with discontinuities (the azimuth is periodic in the interval [0 , π ], leading to problems during the optimization). For this reason, we opted to use the following variables, obtained as combinations of B , Θ B , and Φ B :  \nB ∥ = B cos Θ B BQ = ( B sin Θ B ) 2 cos 2 Φ B BU = ( B sin Θ B ) 2 sin 2 Φ B . (5)  \nThese three quantities are defined in ( -∞ , + ∞ ) and are continuous functions of the magnetic field vector. They also have the additional advantage of decoupling the problem into three unrelated sub-problems: Stokes V is only dependent on B ∥ , Stokes Q is only dependent on BQ and Stokes U is only dependent on BU . Therefore, one could solve each sub-problem independently. This is useful, for instance, if one Stokes parameter has much stronger signals than the rest (typically the case of Stokes V ), which could dominate the optimization process. In that case, one could use  \ndi ff erent weights for each term in the merit function. Note that this last point is only valid for the WFA and not for the general case.', '2.3. Neural fields': "We propose here a general and powerful technique for the inference of magnetic field (and potentially thermodynamical parameters when using models more complex than the WFA) from observations using neural networks. The general idea is depicted in Fig. 1 and described in the following. We use a neural network, f θ ( x , y ), to describe the components of the magnetic field vector as a function of the coordinates. In this case, we describe the magnetic field components in a 2D plane in Cartesian coordinates ( x , y ). These coordinates represent the plane of 'e ff ective' formation height at which the polarization is generated. In the general case in which stratification and time evolution are taken into account, the input coordinates will be the ( x , y , z , t ). For convenience, we normalize all coordinates so that they are mapped to the interval [ -1 , 1]. The magnetic field components are then given by the following simple, but flexible, fully-connected neural network f θ :  \nB = ( B ∥ , BQ , BU ) = f θ ( x ) , (6)  \nwith θ the internal parameters of the neural network and x = ( x , y ).  \nThis approach of describing the magnetic field using NFs has several advantages. First, the number of tunable parameters of the neural network can be potentially fewer than the number of unknowns in all pixels. This might not be especially relevant for the WFA model since there are only 3 unknowns per pixel. However, this will be crucial when applied to stratified inversions where we have many more physical quantities per pixel (temperature, velocity, magnetic field, microturbulence, etc.) in a very dense grid, not only spatial but also in the optical depth domain. Secondly, a NF is a global function in the space. This means that the information introduced by the observation of a single pixel informs the whole solution, leading to a very pronounced regularization e ff ect. This e ff ect is similar to the global character induced by the wavelet decomposition used by Asensio Ramos & de la Cruz Rodríguez (2015). Thirdly, a NF is a continuous and di ff erentiable function of the input coordinates. Therefore, the result of the inversion process is a continuous function that can be evaluated at any arbitrary point. Having a continuous and di ff erentiable magnetic field map can be greatly beneficial for the computation of current sheets though spatial derivatives of the magnetic field (see the application to inversion methods of Pastor Yabar et al. 2021), which otherwise will be greatly a ff ected by  \nthe (potential) presence of noise and inversion artifacts. Finally, it is straightforward to include any explicit additional regularization term in the optimization that depends on the output or any derivative of the output with respect to the input coordinates.", '2.4.1. Parametric representation': 'Before showing the use of neural networks for the WFA problem, we will test first the performance of the neural network to describe the 2D spatial properties of the physical quantities of interest. To that end, we parameterize the magnetic field of a realistic 3D radiative magneto-hydrodynamics (rMHD) simulation. We have used one snapshot from a publicly available enhanced network simulation (Carlsson et al. 2016) performed with the Bifrost code (Gudiksen et al. 2011). Snapshots from this simulation have been extensively used in previous studies to test di ff erent diagnostic strategies (e.g., Leenaarts et al. 2012, 2013; Sukhorukov & Leenaarts 2017; Jurˇcák et al. 2018). The longitudinal magnetic field at 1500 km from the mean continuum formation layer is shown in the left panel of Fig. 2. This panel shows a chromospheric landscape with elongated magnetic features connecting two opposite-polarity patches. This image can be represented with the aid of a NF by minimizing the following loss:  \nL B ∥ = X x , y GLYPH<0> f θ ( x , y ) -B ∥ ( x , y ) GLYPH<1> 2 , (7)  \nwhere we utilize a fully-connected NN with ReLU (Rectified Linear Unit; Fukushima 1969) activation functions. Note that we do not train the neural network in the traditional manner for generalization across multiple datasets; instead, each network is uniquely optimized for a specific dataset to function as a tailored parametric tool, not as a generalized predictive model. The converged solution is found in the second panel of Fig. 2. The solution only approximates the general behavior of the original magnetic field distribution but is too smooth. This smoothness is a direct consequence of the implicit bias of NN, also known as spectral bias (Rahaman et al. 2018), which prevents standard networks from learning high-frequency functions 1 . This is an active area of research, and several strategies have been proposed to alleviate this problem and introduce an implicit bias towards high-frequency signals. One of the most successful strategies is to pass the input coordinates through a Fourier feature mapping γ ( x ), which allows the NF to correctly generate high spatial frequencies (Tancik et al. 2020). This mapping projects the input coordinates onto a high-dimensional space with a set of trigonometric functions:  \nγ ( x ) = [cos(2 π Gx ) , sin(2 π Gx )] T (8)  \nwhere G ∼ N (0 , ω ), i.e., each entry of the vector G is a frequency sampled from a Gaussian distribution with zero mean and standard deviation ω . The parameter ω controls the range of spatial frequencies that the network can reproduce. This will be helpful as a regularization, as we show later. After computing the Fourier features, we pass them through the neural network to obtain the magnetic field. By using a Fourier mapping, we can e ffi ciently reproduce both low and high spatial frequencies, being able to represent the magnetic field with a high fidelity. The third and fourth panels of Fig. 2 show the results of using the Fourier  \nfeatures with di ff erent values of ω . Using ω = 10 (third panel), allows us to capture the lower spatial frequencies, but by increasing it to ω = 60 (fourth panel) we can reliably reproduce all the high-frequency spatial details of the magnetic field map. In the bottom right of each panel, we also quantify the mean absolute error (MAE) between the original simulation and the di ff erent results, decreasing from an average error of 5 G with the ReLU NNto 0.09 G using the NF ( ω = 60). We note that other strategies to alleviate the spectral bias exist. It is worth mentioning that the use of suitable activation functions, such as sinusoids, has also been shown to be very e ff ective in generating high-frequency functions (SIREN; Sitzmann et al. 2020). All these strategies can be seen as a nonlinear extension of Fourier series.  \nIt is important to stress the fact that the number of learnable parameters of the NF is not dependent on the number of pixels in the observations, but rather on the properties of the spatial distribution of the physical quantities. In the example shown in Fig. 2, although the number of pixels is 500 × 500, the number of parameters of the network is ten times smaller, amounting to just 25k. This compact representation is arguably associated with the fact that the magnetic field in the chromosphere, where the magnetic pressure is larger than the gas pressure, tends to be rather smooth and slow-varying over space. This is not to be expected for other quantities, such as the temperature or the velocity, which vary at much smaller spatial scales.  \nThe representations shown in Fig. 2 have been trained by optimizing the loss function of Eq. (7) computed for all pixels in the field-of-view (FoV). However, since the NF is a global function in x , the loss in a given pixel contains some information about the properties of the NF in the surroundings. For this reason, one can train the NF using mini-batches of pixels randomly chosen in the FoV, instead of summing over the whole FoV. To show this, Fig. 3 shows the mean absolute error as a function of iteration when di ff erent mini-batches are selected for each iteration. We can see that the convergence properties when using 10% of the total pixels are already as good as those obtained when using the whole FoV, but 10 times faster in terms of computing time. The sudden decrease in the merit function during the optimization is produced by the scheduler, a module that decreases the learning rate (step size) if there is no improvement after some iterations.', '2.4.2. Magnetic field reconstruction': 'The previous experiment demonstrates that a NF can correctly recover the details of the quantities of interest by their direct observation. But in spectropolarimetry, we only have access to the Stokes profiles and one has to pass through the radiative transfer model to infer the physical quantities. Here we demonstrate that this can be done by interpreting synthetic observations of the Ca i i 8542Å line. We have chosen this line because the WFA approximation on this line is reliable for field strengths up to ∼ 1200 G (Centeno 2018). For this test, we have created synthetic observables from the Bifrost simulation and we run our WFA NF to reproduce the polarization signals that emerge from the simulation. Our goal is to assess the improvement delivered by our new method when compared to the traditional pixel-by-pixel WFA. To this end, and to discard any influence of the line formation details, we follow Morosin et al. (2020) and set the magnetic field in each pixel equal to its vertical average from z = 1000 km to z = 1500 km. Heights are measured assuming that z = 0 km corresponds to the mean continuum formation layer. We compute the synthetic observables using the non-local thermodynamic  \nFigure 4 shows the reconstruction of the magnetic field vector in the synthetic case used before in Fig. 2. The first column shows the original magnetic field vector, given in terms of B ∥ , B ⊥ , and Φ B . The second column shows the inferred magnetic field using  \n<!-- image -->  \n<!-- image -->  \n<!-- image -->  \n<!-- image -->  \n-  \n60  \nFig. 2: Comparison of the parametric representation power of each method. From left to right: the original longitudinal magnetic field at z = 1500 km in the Bifrost simulation, represented using a ReLU neural network, and using a NF with ω = 10 and ω = 60.Fig. 3: Performance of the NF when evaluating di ff erent batches of pixels randomly chosen in the field of view in every iteration.  \n<!-- image -->  \nequilibrium (NLTE) radiative transfer STiC code 2 (de la Cruz Rodríguez et al. 2016, 2019) and add uncorrelated Gaussian noise to the Stokes Q , U , and V profiles. It is important to note that the average magnetic field of this particular snapshot is about 50-100 G, a value much lower than the typical magnetic field found in plage ( ∼ 400 G, Pietrow et al. 2020; Morosin et al. 2022). Consequently, to avoid the signal being buried in the noise, we use a standard deviation of the noise lower than the typical one found in solar observations.  \nThe architecture chosen for the NF is a residual network (ResNet, He et al. 2015) with 2 residual blocks, 64 nodes per layer, and the ELU activation function (Exponential Linear Unit; Clevert et al. 2015). This architecture has proven its e ff ectiveness by showing e ffi cient training and good performance in capturing complex patterns. For the Fourier feature mapping, we have used ω = 60 for the longitudinal magnetic field and ω = 30 for the transverse components. The reason is that the latter is typically more a ff ected by the noise. Using a smaller value of ω encourages the NF not to fit the noise, which is of very high spatial frequency. The magnetic field generated by the NF is used to compute the synthetic observables via the WFA approximation, which are then compared with the observations. In particular, for the longitudinal  \nmagnetic field, and using Eq. (1), we have used the following loss function:  \nL V = X x , y X λ               -CVB ∥ ( x , y | θ ) dI obs x , y d λ        -V obs x , y        2 (9)  \nwhere CV = 4 . 6686 × 10 -13 ¯ g λ 2 0 is a constant for the line of interest, B ∥ ( x , y | θ ) is the NF used to represent the longitudinal field, dI obs x , y / d λ is the derivative of the observed Stokes I profile at pixel ( x , y ), and V obs x , y is the observed Stokes V signal at the same pixel. The derivative of the intensity does not change during the optimization, so it can be pre-calculated and stored before the optimization process occurs.  \nFor the transverse components, using Eq. (2), the loss functions are given by:  \nL Q = X x , y X λ               CQU · BQ ( x , y | θ ) · 1 λ -λ 0 dI obs x , y d λ        -Q obs x , y        2 (10)  \nL U = X x , y X λ               CQU · BU ( x , y | θ ) · 1 λ -λ 0 dI obs x , y d λ        -U obs x , y        2 (11)  \nwhere CQU = 1 . 6347 × 10 -25 λ 4 0 ¯ G . Thanks to the definition of the BQ and BU variables, the losses can be optimized separately. This helps in imposing di ff erent implicit or explicit regularization methods for every variable.  \nThe optimization of every loss function with respect to θ is carried out using the Adam optimizer with a learning rate of 3 · 10 -4 for 100 -500 epochs (depending on the dataset). The derivatives for the backpropagation through the network and the physical model (WFA) are carried out with the automatic di ff erentiation package PyTorch. Finally, after convergence of the NFs, one can recover the full magnetic field vector from B ∥ , BQ , and BU by a final transformation:  \nB ∥ ( x , y ) = B ∥ ( x , y | θ ) B ⊥ ( x , y ) = h BQ ( x , y | θ ) 2 + BU ( x , y | θ ) 2 i 1 / 4 Φ B ( x , y ) = arctan BU ( x , y | θ ) BQ ( x , y | θ ) ! . (12)  \n[pixels]  \ny  \nx [pixels]  \n[G]  \nFig. 4: Comparison of the reconstruction of the magnetic field vector from the synthetic Ca i i 8542Å spectra calculated from the simulation (in rows: line-of-sight component, transverse component, and azimuth angle). From left to right: original magnetic field from the simulation, magnetic field inferred by the pixel-wise WFA, and results using the WFA NF.  \n<!-- image -->  \nthe traditional pixel-based WFA and the third row shows the inferred magnetic field using the NFs. The quality of the results is a ff ected, fundamentally, by the noise level and the regularization properties of NF. We have tested the performance of the NF for di ff erent noise levels and values of ω , finding the same consistent behavior. The results summarized in Fig. 4 are for the particular configuration with a noise level of 10 -3 for Stokes V and 10 -4 for Stokes Q and U , both given in units of the continuum intensity. The longitudinal field inferred with the NF is very similar to that of the traditional WFA in general terms. The NF strongly damps the high-frequency components of the magnetic field associated with the presence of noise, but the overall structure is very similar. The key reason is that the longitudinal magnetic field is a quantity that is well constrained by the observations even in the presence  \nof noise because the Stokes V signals are typically above the noise and the estimated value is statistically unbiased and coincides with the original value (see Martínez González et al. 2012).  \nThe NF produces a much better result for the transverse component and the azimuth of the magnetic field, which are much closer to the real ones than those obtained with the traditional WFA. In this case, the implicit spatial regularization of the NF is able to provide a much better solution. The pixel-by-pixel WFA tends to overestimate the transversal component of the magnetic field, producing a background component over the FoV which is proportional to the noise level. This e ff ect is well-known and produced because the maximum-likelihood solution is biased Martínez González et al. (2012). The standard approach to deal with this bias is to avoid the regions where this e ff ect has a strong  \nimpact on any subsequent analysis. Here we show that the NF is able to provide a better estimate of the magnetic field by finding a solution that is more coherent with the surroundings. This produces a mitigation of the bias of the transversal component. At the bottom right of each panel, we have quantified both approaches, retrieving an average error 2.5 -4.5 times lower with the NF WFA compared with the pixel-wise approach. Our results confirm the advantages of the spatial regularization found by Morosin et al. (2020). Note that these small errors do not fully encapsulate the complexities found in actual observations, which are influenced by various systematic factors such as noise or spectral and spatial degradation. Nonetheless, within our idealized setting, the inference using the NF WFA is indicative of the potential improvements. Lastly, our calculations provide two more conclusions. The first one is that, if we decrease the value of ω , the NF tends to produce an excessively smooth solution. Although this is bad in general, it can be an advantage in very noisy observations. The second one is the finding that the larger the noise level, the better the reconstruction of the magnetic field using the NF WFA is compared to the traditional WFA (see Fig. A.1 in the Appendix for a comparison using an increased noise level).', '3.1. Example with real observations': 'After confirming with simulations that the WFA NF is able to recover the magnetic field with a higher fidelity than the standard pixel-by-pixel WFA in noisy cases, we apply it to real observations. We have used observations (Leenaarts et al. 2018; Yadav et al. 2023) from the active region NOAA 12593 observed on 2016-09-19 between 09:31:29 UT and 09:57:03 UT with the CRISP (Scharmer et al. 2008) instrument at the Swedish 1-m Solar Telescope (SST; Scharmer et al. 2003). The selection of the regularization frequencies ω was guided by empirical testing: we experimented with di ff erent values to find an optimal balance that minimizes noise while preserving critical features of the magnetic field, particularly the transverse component. The results from the analysis of the first time frame are shown in Fig. 5. The first row shows the results with the pixel-wise WFA and the second row displays those obtained when applying the WFA NF. As expected, since the Stokes V signals are well above the noise, the inference with both methods is very similar. In contrast, the pixel-wise WFA tends to estimate the transverse magnetic field larger than 1000 G in many locations of the field of view. This is the mentioned bias e ff ect, with very strong values because in the presence of a hot magnetic canopy, the line source function is very shallow in the chromosphere and the resulting line profile has a flat line core (see Appendix A of Morosin et al. 2020). In other words, the pixel-wise WFA compensates the almost-zero Stokes I derivative with a very large magnetic field value. This e ff ect is more noticeable in Fabry-Pérot observations due to the poor sampling of Stokes I , as shown in Díaz Baso et al. (2023). The NF, on the other hand, is able to provide a more coherent solution in the spatial domain without using unrealistic values. The maximum values are now below 800 G, where most of them are in the edge of the lower-right polarity (penumbra of the sunspot) and in between the small polarities in the FoV.', '3.2. Challenging case and additional spatial regularization': 'We have used observations of the active region NOAA AR 12723 recorded on 2018-09-30 in the Ca i i 8542 Å line by Vissers et al. (2022) with the CRISP instrument at the SST consisting of a  \nmosaic of four overlapping pointings. This target was selected to explore the behavior of the NF when the magnetic field is particularly weak, but with a simple enough connectivity to investigate what additional information we could add to the inference problem. In this case, the NF WFA does a job similar to the pixel-wise WFA because the magnetic field is mainly concentrated at the sunspots and decreases rapidly for increasing distances from the sunspots. However, the formulation of the inversion process in terms of a NF allows us to include additional regularizations.  \nThe results of the inversions are shown in Fig. 6. The longitudinal magnetic field, the transverse magnetic field, and the azimuth of the magnetic field are shown in the first, second, and third columns, respectively. The results clearly show that a NF is marginally regularizing the inference. The quality of the inferred magnetic field far from the sunspots is similar between both the NF WFA and the pixel-wise WFA. The estimation of the magnetic field is slightly more spatially coherent, as expected, but the overall structure is very similar. This is a clear example of a limiting case in which there is not enough information to constrain the solution.  \nIn order to improve the magnetic field estimation, we have implemented an explicit regularization. It is implemented by guiding the NF to simultaneously obey another physical constraint, apart from fitting the spectropolarimetric observations. This constraint is implemented as a regularization term in the loss function parameterized with a hyperparameter λ , which penalizes the distance between the magnetic field configuration and the magnetic field configuration from the external source of information. Given that the longitudinal magnetic field is well constrained, we will focus here on adding a regularization to the transverse component, i.e.:  \nL = L Q + L U + λ L reg . (13)  \nAs a first example, the third row of Fig. 6 shows the result when L reg = L pot, where L pot is the mean squared di ff erence between the NF and a pre-calculated potential field extrapolation B pot from the well-constrained longitudinal magnetic field component. One would want to calculate the di ff erence between these two magnetic fields defining L pot following:  \nL pot = X x , y GLYPH<16> B ⊥ -B ⊥ , pot GLYPH<17> 2 + X x , y GLYPH<16> Φ B -Φ B , pot GLYPH<17> 2 . (14)  \nHowever, as we have not disambiguated the magnetic field azimuth, we have to calculate the distance between the corresponding analog quantities BU , pot, and BQ , pot :  \nL pot = X x , y GLYPH<16> BQ -BQ , pot GLYPH<17> 2 + X x , y GLYPH<16> BU -BU , pot GLYPH<17> 2 . (15)  \nWhen the value of λ is increased during the optimization, the NF starts to incorporate the information of the potential field extrapolation. However, even with a small regularization value, we can already see from Fig. 6 that the azimuth of the magnetic field becomes more spatially coherent, but the new transverse magnetic field becomes much stronger than the one estimated only from reproducing the polarization signals. This experiment shows that this particular region is far from being potential and incorporating this information will worsen the fits as soon as we increase the value of λ . More complex extrapolations can be performed but the idea here is to show how to incorporate external information into the inference problem.  \nFinally, we also explore the idea of incorporating the orientation of the chromospheric fibrils as if they were aligned with  \nFig. 5: Magnetic field reconstruction from a Ca i i 8542Å observation using the pixel-wise WFA (top row) and using the NF WFA with ω = 120 for B ∥ and ω = 80 for B ⊥ & Φ B (bottom row). Columns show the magnetic field in terms of the longitudinal component, the transverse component, and the azimuth angle.  \n<!-- image -->  \n‖  \n⊥  \nthe magnetic field. In fact, this idea has been used to improve nonlinear force-free modeling of coronal fields (Wiegelmann et al. 2008), given the limitations of the force-free assumption of the photospheric boundary (DeRosa et al. 2015). Extrapolations performed starting from a chromospheric vector boundary condition (Fleishman et al. 2017) or starting from the photosphere and adding even an incomplete set of chromospheric magnetic field data (Fleishman et al. 2019) can measurably improve the reconstruction of the coronal magnetic field, connectivity, and electric currents. This information can potentially also improve the inference of the magnetic field, especially in areas away from strong magnetic field concentrations.  \nTo calculate the distance between the magnetic field azimuth Φ B and the direction of the fibrils Φ fib, we need to convert all angles to corresponding points on the unit circle to avoid the ambiguity problem, and then we can compute the distance of  \nthese points. The fourth row of Fig. 6 shows the result when L reg = L fib, with  \nL fib = X x , y [sin(2 Φ B ) -sin(2 Φ fib)] 2 + X x , y [cos(2 Φ B ) -cos(2 Φ fib)] 2 , (16)  \ni.e., the mean squared di ff erence between the NF azimuth and the direction of the fibrils, as calculated from the intensity image. In order to infer the orientation of the fibrils from the observations we have used the following procedure: i ) we have used the core of the Ca i i 8542 Å line to detect the fibrils in the chromosphere 3 ,  \n‖  \n⊥  \n[pixels]  \ny  \nFig. 6: Magnetic field inference from a Ca i i 8542Å observation using the pixel-wise WFA, the NF WFA, and two additional approaches introducing an explicit regularization term: using the information of a potential extrapolation of the magnetic field (third row) and using the orientation of the fibrils (fourth row). The first column shows the longitudinal magnetic field, the second column shows the transverse magnetic field and the third column shows the azimuth of the magnetic field.  \n<!-- image -->  \ni i ) we apply a Sobel operator in each axis and take the arctangent to retrieve the orientation of the fibrils, which is collapsed to the range (0,180) degrees to avoid the 180 degrees ambiguity and i i i ) a Gaussian filter is applied to remove small artifacts at the edges of the fibrils (see Fig. A.2 in the Appendix for more information). As a result of the inference, Fig. 6 shows a magnetic field that is aligned in general with the fibrils while still reproducing the polarization signals. The middle panel shows that after incorporating the orientation of the fibrils, the transverse component remains almost the same. In fact, the estimation of the orientation of the fibrils fails in the umbra where fibrils are not visible (see Fig. A.2)  \nbut the strong polarization signals are enough to compensate for that. This guided inferred magnetic field can be a much better boundary condition for coronal field extrapolations.  \nOther potential regularizations that we should explore in the future are forcing the divergence-free condition or the suppression of strong electric currents. Both constraints can be computed from derivatives of the output of the neural network with respect to the input coordinates, which can be computed e ffi ciently with techniques from automatic di ff erentiation. This could allow us to resolve the Zeeman-180 degree azimuth ambiguity at the same time we are reproducing the spectra.  \npixel-wise  \n[G]  \nneural-field  \n[G]  \nFig. 7: Longitudinal magnetic field (upper row) and transverse component (lower row) inferred using the pixel-wise WFA and the temporal WFA NF for a time series of the active region NOAA 12593 observed on 2016-09-19 with the SST / CRISP. The rightmost column shows the temporal evolution of the magnetic field for a particular pixel indicated as the intersection of the dashed lines in the middle panel.  \n<!-- image -->', '3.3. Temporal regularization': 'The NF can be easily extended to the case where the magnetic field is not static but evolves with time. By imposing temporal coherence in the solution, one can obtain a better estimate of the magnetic field, as shown by de la Cruz Rodríguez & Leenaarts (2024). From a technical point of view, adding the time dependence can be done by adding t as an additional input parameter of the NF:  \nB = ( B ∥ , BQ , BU ) = f θ ( x , t ) . (17)  \nApart from this change, inferring the magnetic field proceeds exactly as before, with the only change that the optimization process requires minimizing the loss function over the spatio-temporal domain. The number of unknowns in the explicit temporal regularization of de la Cruz Rodríguez & Leenaarts (2024) scales linearly with the number of observed time steps ( nt ) since it infers the value of the magnetic field at all nxny pixels of the field-ofview. This requires solving a very large linear system of equations of size nxnynt × nxnynt . On the contrary, the NF produces a much more compact representation of the magnetic field because it only  \nrequires adding a few weights from the input layer to the Fourier feature mapping layer. Since the magnetic field contains higher frequencies in the spatial directions than in the temporal direction, we implement the Fourier feature mapping with ω t for the time and ω xy for the spatial coordinates, with ω t < ω xy .  \nTo showcase this approach, we have used a 26-minute time series of the active region NOAA 12593 described in Sec. 3.1. We optimize the temporal WFA NF on the Ca i i 8542 Å observations of this time series. For this particular example, we have used a temporal regularization of ω t = 3 and a spatial regularization of ω xy = 80. Higher values prevented the neural network from converging correctly. The results of the inference are shown in Fig. 7 for the longitudinal magnetic field and the transverse component. The rightmost column shows the temporal evolution of the magnetic field component for the particular pixel shown in the middle panel.  \nIn the case of the longitudinal magnetic field (first row of Fig. 7), the NF is able to capture the details of the spatial distribution of the emerging flux region. In the extracted pixel, the NF is also able to capture the temporal evolution of the magnetic  \nfield. The fluctuations of pixel-wise inversion are of the order of ∼ 100 G, which are compatible with the noise amplitude of the observations. This makes us confident that the implicit bias introduced in the NF with the small value of ω t correctly captures the time variation of the longitudinal component of the magnetic field. However, since this particular region is very dynamic, one could argue that a less restrictive temporal regularization could be needed to properly capture the details of the small-scale changes and a higher ω t would be necessary in this type of scenario.  \nIn the case of the transverse magnetic field (second row of Fig. 7), there is a much larger di ff erence between the output of the NF and that of the traditional pixel-wise WFA. The traditional WFA tends to estimate a transverse magnetic field larger than 1000 G in the center of the FoV far from the sunspot, where we have weak polarization signals. This is again the bias produced by the noise described before. The NF, on the other hand, is able to provide a more coherent solution both spatially and temporally. Both approaches retrieve very similar magnetic field values where the signals are stronger. When compared with the previous section where only spatial regularization was employed, temporal regularization is particularly e ff ective in reducing the background noise (de la Cruz Rodríguez & Leenaarts 2024).', '4. Summary and conclusions': "In this study, we investigated the use of neural fields to parameterize the magnetic field for magnetic field inference. We have shown the capabilities of NFs to solve static and time-dependent magnetic field inferences. This implementation 4 comes with several important advantages.  \nFirst, by reformulating the problem as a global problem (instead of pixel-wise independent problems), the NF can produce a much more compact representation, decreasing the number of parameters to optimize. This reduction generally depends on both the spatial complexity of the inferred physical quantities and the e ffi ciency of the chosen neural architecture to represent such complexity. We believe that, for three-dimensional cases like the inversion of Stokes profiles with stratified atmospheres, NFs will represent an exceptionally compact representation of the physical conditions (see, for example, Asensio Ramos 2023). So, we anticipate that NFs will become crucial as new modern instruments and telescopes are providing bigger FoV of more complex data (e.g. at the SST, the recently installed CRISP cameras o ff er a FoV diameter of 87 '' and the forthcoming CRISP2 will o ff er a FoV of 2 arcminutes).  \nSecond, using a NF to describe the magnetic field as a continuous di ff erentiable function allows us to obtain a better estimation of the magnetic field in places where the signals are buried in the noise, without smearing out the details of locations where the signals are strong. Choosing adequate regularization frequencies ω is crucial to obtain results that are not overly smooth. These frequencies should be chosen so that the quality of the fit is not degraded but still maintains sharp gradients in locations where the signals significantly impact the quality of the fit. In fact, NFs seem to be key in the inference of the transverse magnetic field, which the pixel-wise WFA tends to overestimate. This new implementation can help us to better understand and quantify chromospheric heating and its relation with the strength of the horizontal magnetic field in the low chromosphere (Leenaarts et al. 2018; Díaz Baso et al. 2021; da Silva Santos et al. 2022).  \nThird, the present work is based on a simple forward model for the Stokes profiles. A NF version of the WFA is not realistically competitive in terms of speed with other WFA implementations. For instance, the explicitly regularized WFA implementation of Morosin et al. (2020) can estimate the magnetic field of the FoV in less than a second, while the NF version requires ∼ 30 seconds. The temporal regularization takes also more time, almost ∼ 3 minutes in an o ff -the-shelf GPU, compared with ∼ 10 minutes in a CPU. The main reason for this large processing time is the relatively slow convergence of the NF given that it is optimized using first-order gradient-based techniques. On the other hand, the loss function in spectropolarimetric inversions is often optimized using (quasi-) second-order methods such as the Levenberg-Marquardt algorithm. Second-order methods require the construction of a very large approximate Hessian matrix that can impact memory consumption. For instance, for an observation with 1000 × 1000 pixels and 50 time steps and using a Milne Eddington model ( ∼ 10 free parameters), the Hessian matrix is of size 5 × 10 8 × 5 × 10 8 . In any case, the global Hessian matrix is relatively sparse. Depending on the sparsity degree of the Hessian matrix, the resolution of the coupled linear system of equations can pose a severe computational challenge, even when e ffi cient iterative methods are used (e.g., GMRES or BICGSTAB). Imposing nearest neighbor regularization yields a very compact and sparse matrix that can be e ffi ciently inverted. More dense cases, originating for example from the inclusion of an extended spatial point-spread-function or horizontal coupling by 3D radiative transfer e ff ects, could be trivially included in this framework, whereas it is not trivial to model the inverse problem.  \nFourth, modern automatic di ff erentiation frameworks, like PyTorch, allow us to seamlessly use more complex forward models, such as a Milne-Eddington model, or solve the non-LTE inversion problem in a stratified atmosphere. In Asensio Ramos & Díaz Baso 2019, we already anticipated that traditional predictive neural networks, despite their remarkable speed, are not explicitly fitting Stokes profiles and the introduction of a di ff erentiable forward synthesis would notably increase the optimization time. Considering that the forward models are the bottleneck in complex spectropolarimetric inversions, emulators of the radiative transfer model (e.g., Asensio Ramos et al. 2024) emerges as a crucial strategy to speed up the calculations. Additionally, these frameworks allow us to seamlessly speed up the calculations using GPUs. Adding extra regularization terms to guide the solution is straightforward in these frameworks. As mentioned, by improving the estimation of the magnetic field at the chromospheric level, we can perform better coronal magnetic field extrapolations, and the chromospheric fibrils contain valuable information about the non-potentiality of the magnetic field which should be integrated into the inference (Jing et al. 2011). Apart from the ones used in this work (alignment of the magnetic field with the chromospheric fibrils or similarity to a pre-computed magnetic field extrapolation), one can think of adding Tikhonov regularization on the physical quantities or their spatial derivatives, sparsity constraints using linear transformation like wavelets (e.g., Asensio Ramos &de la Cruz Rodríguez 2015) or a divergence-free constrain. By extending this model to include additional constraints we could potentially resolve the Zeeman-180 degree azimuth ambiguity directly within the inversion process (Štˇepán et al. 2022, 2024). This would enhance the accuracy and reliability of the inferred magnetic field vectors.  \nFinally, a natural extension would be a probabilistic reconstruction (i.e., providing the uncertainty of the magnetic field) by using gradient-based variational inference, as shown by MishraSharma & Yang (2022) in the context of gravitational lens recon-  \nstruction. This could be accomplished, for example, by modeling the magnetic field distribution using a normalizing flow (Díaz Baso et al. 2022). Another point to explore is the accuracy in reproducing very high-frequency features in the observations because our Fourier Feature layer becomes less stable when we increase the complexity of the problem. A way of mitigating this problem can be using a multi-scale representation (Dolean et al. 2023; Saragadam et al. 2022) or add higher frequencies progressively as the training progresses (Asensio Ramos et al. 2024). Having demonstrated the potential of the method in a proof-of-principle setting, we leave these extensions to future work.  \nIn summary, NFs allow us to improve the reconstruction of the magnetic field properties of the solar atmosphere, especially suitable for imaging spectropolarimeters with large fields of view and a scarce wavelength sampling but also for integral-field spectropolarimeters (van Noort et al. 2022; Rouppe van der Voort et al. 2023) where, although the FoV is smaller, the temporal cadence is very high and the temporal regularization will hold much better. These properties make NFs valuable for the data taken with the next generation of telescopes such as the existing Daniel K. Inouye Solar Telescope (DKIST; Rimmele et al. 2020) and the upcoming European Solar Telescope (EST; Quintero Noda et al. 2022).  \nAcknowledgements. CJDB acknowledges M. L. DeRosa for valuable discussions on future application of NF inversion methods. This research is supported by the Research Council of Norway, project number 325491, and through its Centres of Excellence scheme, project number 262622. AAR acknowledges financial support from the Agencia Estatal de Investigación del Ministerio de Ciencia, Innovación y Universidades (MCIU / AEI) and the European Regional Development Fund (ERDF) through project PID2022-136563NB-I00. This project has been funded by the European Union through the European Research Council (ERC) under the Horizon Europe program (MAGHEAT, grant agreement 101088184). The NSO is operated by the Association of Universities for Research in Astronomy, Inc., under cooperative agreement with the National Science Foundation. The Swedish 1-m Solar Telescope is operated on the island of La Palma by the Institute for Solar Physics of Stockholm University in the Spanish Observatorio del Roque de los Muchachos of the Instituto de Astrofísica de Canarias. The Institute for Solar Physics is supported by a grant for research infrastructures of national importance from the Swedish Research Council (registration number 2021-00169). We acknowledge the community e ff ort devoted to the development of the following open-source packages that were used in this work: numpy ( numpy.org ), matplotlib ( matplotlib.org ), scipy ( scipy.org ), astropy ( astropy.org ) and sunpy ( sunpy.org ). This research has made use of NASA's Astrophysics Data System Bibliographic Services.", 'References': "- Asensio Ramos, A. 2023, Sol. Phys., 298, 135\n- Asensio Ramos, A. & de la Cruz Rodríguez, J. 2015, A&A, 577, A140\n- Asensio Ramos, A. & Díaz Baso, C. J. 2019, A&A, 626, A102\n- Asensio Ramos, A. & Pallé, E. 2021, A&A, 646, A4\n- Asensio Ramos, A., Westendorp Plaza, C., Navarro-Almaida, D., et al. 2024, MNRAS, 531, 4930\n- Carlsson, M., Hansteen, V. H., Gudiksen, B. V., Leenaarts, J., & De Pontieu, B. 2016, A&A, 585, A4\n- Centeno, R. 2018, ApJ, 866, 89\n- Clevert, D.-A., Unterthiner, T., & Hochreiter, S. 2015, arXiv e-prints, arXiv:1511.07289\n- da Silva Santos, J. M., Danilovic, S., Leenaarts, J., et al. 2022, A&A, 661, A59\n- da Silva Santos, J. M., Reardon, K., Cauzzi, G., et al. 2023, ApJ, 954, L35\n- De Ceuster, F., Ceulemans, T., Decin, L., Danilovich, T., & Yates, J. 2024, arXiv e-prints, arXiv:2402.18525\n- de la Cruz Rodríguez, J. 2019, A&A, 631, A153\n- de la Cruz Rodríguez, J. & Leenaarts, J. 2024, A&A, 685, A85  \nde la Cruz Rodríguez, J., Leenaarts, J., & Asensio Ramos, A. 2016, ApJ, 830, L30  \n- de la Cruz Rodríguez, J., Leenaarts, J., Danilovic, S., & Uitenbroek, H. 2019, A&A, 623, A74\n- DeRosa, M. L., Wheatland, M. S., Leka, K. D., et al. 2015, ApJ, 811, 107\n- Díaz Baso, C. J., Asensio Ramos, A., & de la Cruz Rodríguez, J. 2022, A&A, 659, A165\n- Díaz Baso, C. J., de la Cruz Rodríguez, J., & Danilovic, S. 2019a, A&A, 629, A99\n- Díaz Baso, C. J., de la Cruz Rodríguez, J., & Leenaarts, J. 2021, A&A, 647, A188 Díaz Baso, C. J., Martínez González, M. J., & Asensio Ramos, A. 2019b, A&A, 625, A128\n- Díaz Baso, C. J., Rouppe van der Voort, L., de la Cruz Rodríguez, J., & Leenaarts, J. 2023, A&A, 673, A35\n- Dolean, V., Heinlein, A., Mishra, S., & Moseley, B. 2023, arXiv e-prints, arXiv:2306.05486\n- Dominguez-Tagle, C., Collados, M., Lopez, R., et al. 2022, Journal of Astronomical Instrumentation, 11, 2250014\n- Fleishman, G., Mysh'yakov, I., Stupishin, A., Loukitcheva, M., & Anfinogentov, S. 2019, ApJ, 870, 101\n- Fleishman, G. D., Anfinogentov, S., Loukitcheva, M., Mysh'yakov, I., & Stupishin, A. 2017, ApJ, 839, 30\n- Fukushima, K. 1969, IEEE Transactions on Systems Science and Cybernetics, 5, 5\n- Gudiksen, B. V., Carlsson, M., Hansteen, V. H., et al. 2011, A&A, 531, A154 He, K., Zhang, X., Ren, S., & Sun, J. 2015, arXiv e-prints, arXiv:1512.03385 Jarolim, R., Tremblay, B., Rempel, M., et al. 2024, ApJ, 963, L21\n- Jing, J., Yuan, Y., Reardon, K., et al. 2011, ApJ, 739, 67\n- Jurˇcák, J., Štˇepán, J., Trujillo Bueno, J., & Bianda, M. 2018, A&A, 619, A60 Landi Degl'Innocenti, E. & Landi Degl'Innocenti, M. 1973, Sol. Phys., 31, 299 Landi Degl'Innocenti, E. & Landolfi, M. 2004, Polarization in Spectral Lines (Kluwer Academic Publishers)\n- Leenaarts, J., Carlsson, M., & Rouppe van der Voort, L. 2012, ApJ, 749, 136 Leenaarts, J., de la Cruz Rodríguez, J., Danilovic, S., Scharmer, G., & Carlsson, M. 2018, A&A, 612, A28\n- Leenaarts, J., Pereira, T. M. D., Carlsson, M., Uitenbroek, H., & De Pontieu, B. 2013, ApJ, 772, 90\n- Liaudat, T. I., Mars, M., Price, M. A., et al. 2023, arXiv e-prints, arXiv:2312.00125 Martínez González, M. J., Asensio Ramos, A., Carroll, T. A., et al. 2008, A&A, 486, 637\n- Martínez González, M. J., Manso Sainz, R., Asensio Ramos, A., & Belluzzi, L. 2012, MNRAS, 419, 153\n- Mishra-Sharma, S. & Yang, G. 2022, in Machine Learning for Astrophysics, 34 Morosin, R., de la Cruz Rodríguez, J., Díaz Baso, C. J., & Leenaarts, J. 2022, A&A, 664, A8\n- Morosin, R., de la Cruz Rodríguez, J., Vissers, G. J. M., & Yadav, R. 2020, A&A, 642, A210\n- Parikh, N. & Boyd, S. 2014, Foundations and Trends in Optimization, 1, 1 Pastor Yabar, A., Borrero, J. M., Quintero Noda, C., & Ruiz Cobo, B. 2021, A&A, 656, L20\n- Paszke, A., Gross, S., Massa, F., et al. 2019, arXiv e-prints, arXiv:1912.01703 Pietrow, A. G. M., Kiselman, D., de la Cruz Rodríguez, J., et al. 2020, A&A, 644, A43\n- Quintero Noda, C., Schlichenmaier, R., Bellot Rubio, L. R., et al. 2022, A&A, 666, A21\n- Rahaman, N., Baratin, A., Arpit, D., et al. 2018, arXiv e-prints, arXiv:1806.08734 Rimmele, T. R., Warner, M., Keil, S. L., et al. 2020, Sol. Phys., 295, 172\n- Rouppe van der Voort, L. H. M., van Noort, M., & de la Cruz Rodríguez, J. 2023, A&A, 673, A11\n- Saragadam, V., Tan, J., Balakrishnan, G., Baraniuk, R. G., & Veeraraghavan, A. 2022, arXiv e-prints, arXiv:2202.03532\n- Scharmer, G. B., Bjelksjo, K., Korhonen, T. K., Lindberg, B., & Petterson, B. 2003, in Proc. SPIE, Vol. 4853, Innovative Telescopes and Instrumentation for Solar Astrophysics, ed. S. L. Keil & S. V. Avakyan, 341-350\n- Scharmer, G. B., Narayan, G., Hillberg, T., et al. 2008, ApJ, 689, L69\n- Sitzmann, V., Martel, J. N. P., Bergman, A. W., Lindell, D. B., & Wetzstein, G.\n- 2020, arXiv e-prints, arXiv:2006.09661\n- Sukhorukov, A. V. & Leenaarts, J. 2017, A&A, 597, A46\n- Tancik, M., Srinivasan, P. P., Mildenhall, B., et al. 2020, arXiv e-prints, arXiv:2006.10739\n- van Noort, M. 2012, A&A, 548, A5\n- van Noort, M., Bischo ff , J., Kramer, A., Solanki, S. K., & Kiselman, D. 2022, A&A, 668, A149\n- Vissers, G. J. M., Danilovic, S., de la Cruz Rodríguez, J., et al. 2021, A&A, 645, A1\n- Vissers, G. J. M., Danilovic, S., Zhu, X., et al. 2022, A&A, 662, A88\n- Štˇepán, J., del Pino Alemán, T., & Trujillo Bueno, J. 2022, A&A, 659, A137\n- Štˇepán, J., del Pino Alemán, T., & Trujillo Bueno, J. 2024, arXiv e-prints, arXiv:2407.20926\n- Wiegelmann, T., Thalmann, J. K., Schrijver, C. J., De Rosa, M. L., & Metcalf, T. R. 2008, Sol. Phys., 247, 249\n- Yadav, R., Díaz Baso, C. J., de la Cruz Rodríguez, J., Calvo, F., & Morosin, R. 2021, A&A, 649, A106\n- Yadav, R., Kazachenko, M. D., Afanasyev, A. N., de la Cruz Rodríguez, J., & Leenaarts, J. 2023, ApJ, 958, 54  \nDíaz Baso et al.: Exploring spectropolarimetric inversions using neural fields", 'Appendix A: Additional figures': '[pixels]  \ny  \nx [pixels]  \n[G]  \nFig. A.1: Same as Fig. 4 for an increased noise level. From left to right: original magnetic field from the simulation, magnetic field inferred by the pixel-wise WFA and results using the WFA NF.  \n<!-- image -->  \nFig. A.2: Steps to retrieve the orientation of the fibrils using the intensity of the Ca i i line: the orientation (middle panel) is obtained by applying Sobel filters to the monochromatic image at the core (top panel), which is later filtered (bottom panel).  \n<!-- image -->'}