dataesr/scientific-paragraphs-categorization huggingface dataset:
Time 1 A corresponds to the approximated computation time to estimate 1 proportion matrix A (closer to real applications on one dataset) Bold acrononyms are used to identify methods in Figs. 3 and 4 both_ meanwNMFMeDeCom b_MEA both 5. 000 most variable probes ICA, selection of top- contributing genes MeDeCom NMF with snmf/r method Averaged DNAm and RNAm proportion matrix both_ wNMFMeDeCom b_COM both 5. 000 most variable probes ICA, selection of top-contributing genes MeDeCom with the A matrix computed on RNA as startA parameter NMF with snmf/r method DNAm deconvo- lution uses RNA deconvolution as input both_wICA b_WIC both 5. 000 most variable probes / ICA weighted by top-contributing probes ICA weighted by top-contributing genes Averaged DNAm and RNAm propor- tion matrix DNAm_MeDeCom DNAm_wICA m_MDC m_WIC DNAm DNAm 5.
The next important point is that this study is presenting a new control method for the system. All the recent studies were based on the conventional PI (Proportional-Integral) or PID (Proportional-Integral-Derivative) controllers, but here, the conventional controllers are replaced with PR (Proportional-Resonant) controllers. For the present system, using a PR controller results in a wider range of stability, which allows us to find the optimum point of the system by varying the reference velocity amplitude and frequency. Finally, the effect of reference velocity parameters on the system was studied. Afterward, based on the physical limitations, the system based on the reference velocity parameters was optimized, which has not been done before. It should be noted that all the models were done in MATLAB Simulink®.
FPSE Analysis The method that was used to develop the thermodynamic model of the FPSE is explained step by step in Table  1  with the related equations and descriptions. This model was developed in MATLAB Simulink®. It should be noted that in order to have a more precise model, the regenerator was divided into two parts ('1, '2), ) I + I ) I + H ) H + J ) J 9 " 0 / K6KFL ' F G ∆" / 1 2 N O + |+ | ; / *, , '1, '2 can be calculated based on the following table :.
Combined System Analysis Coupling FPSE with PMLSM means coupling all the related equations together. To do this, since the PMLSM mover is connected to the FPSE power piston, their velocity and acceleration will be the same; thus in the PMLSM equations will be replaced with. Furthermore, the dynamic equation of the PMLSM will be coupled with the dynamic equation of the FPSE power piston as: / C 3" 0 1 " a 7 + 2b 1 E C + b E i (2. 3. 1) By making these changes in the PMLSM and FPSE set of equations, two systems can be coupled in MATLAB Simulink®. The input parameters of the combined system are presented in Table  3. The working gas is Helium. Based on the input parameters of Table  3 , the results of the combined system modeling are presented in Figure  3  -Figure  6. The reference value of 4 is equal to zero and for the velocity, the reference is a sinusoidal wave with an amplitude of 1.
We describe and demonstrate an optimization-based x-ray image reconstruction framework called Adorym. Our framework provides a generic forward model, allowing one code framework to be used for a wide range of imaging methods ranging from near-field holography to and fly-scan ptychographic tomography. By using automatic differentiation for optimization, Adorym has the flexibility to refine experimental parameters including probe positions, multiple hologram alignment, and object tilts. It is written with strong support for parallel processing, allowing large datasets to be processed on high-performance computing systems. We demonstrate its use on several experimental datasets to show improved image quality through parameter refinement.
We will show in Section 2. 2 that we achieved this by packaging each forward model as an individual Python class that contains the prediction function and the loss function. As long as new variants of the class are created with both components following the input/output requirements, users can get it to work with AD immediately after telling the program to calculate the loss using that forward model. The same plug-and-play readiness also applies to refinable parameters and optimizers. • The framework should not be bound to a certain AD library. There are a variety of AD packages available, and each of them are uniquely advantageous in some aspects. We have thus created a unified frontend in our framework that wraps two AD libraries, namely PyTorch and Autograd, and used the application programming interfaces (APIs) from that frontend to build all forward models.
• The framework also needs to be implemented in a language that has a large community of scientific computation users, and has the API support of most popular AD libraries. The language itself should also be portable, so that the program can be run on a wide range of platforms. As such, we choose to implement our framework in Python. Our design following these criteria leads to Adorym, which stands for Automatic Differentiation-based Object Retrieval with Dynamical Modeling. The same name appeared in our early publication on the algorithm for reconstructing objects beyond the depth-of-focus limit  [14] , where the notion of "dynamical modeling" means both that the forward model accounts for dynamical scattering in thick samples using multislice propagation, and that the forward model can be dynamically adjusted for various scenarios thanks to AD.
Methods and theories With the aim of maximizing the applicability of Adorym to a wide range of x-ray imaging techniques, we adhered to modular and object-oriented programming principles when designing it. In this section, we briefly introduce the most crucial modules and infrastructures of Adorym -namely, its data format, its forward models and loss functions, its AD backends, and its parallelization scheme. These parts are directly relevant to the realization of Adorym's versatility, flexibility, and scalability. While we will limit our narrative to these key features of Adorym in the main text, readers can refer to the supplementary materials for further detail. A full picture illustrating its architecture is shown in Fig. 2.
Data format and array structures Adorym uses HDF5 files  [29]  for input and output, where acquired images are saved as a 4D dataset with shape [num_angles, num_tiles, len_detector_y, len_detector_x]. This is a general data format that is compatible towards more specific imaging types: for example, 2D ptychography has num_angles = 1 and num_tiles > 1, while full-field tomography has num_tiles = 1 and num_angles > 1. The last two dimensions specify a 2D image which is referred to as a "tile. " For ptychography, a tile is just a single diffraction pattern. When dealing with full-field data from large detector arrays, Adorym provides a script to divide each image into several subblocks or tiles, so that the divided image data can be treated in a way just like ptychography, where only a small number of these tiles are processed each time.
AD engines and optimizers The automatic differentiation (AD) engine is the cornerstone of Adorym: it provides the functionality to calculate the gradients of the loss function with regards to the object, the probe, and other parameters. Adorym uses two AD backends: Autograd  [47] , and PyTorch  [48]. Autograd builds its data type and functions on the basis of the popular scientific computation package NumPy  [49]  and SciPy  [50] ; these in turn can make use of hardware-tuned libraries such as the Intel Math Kernel library  [51]. However, Autograd does not have built-in support for graphical processing units (GPUs). This shortcoming is addressed in PyTorch, which also has a larger user community. Both libraries are dynamic graph tools that allow the computational graph (representing the forward model) to be altered at runtime  [52].
This allows for more flexible workflow control, and easier debugging. In order for users to easily switch between both backends, we have built a common front end for them in the wrapper module. This module provides a unified set of APIs to create optimizable or constant variables (arrays in Autograd, or tensors in PyTorch), call functions, and compute gradients. Optimizers define how gradients should be used to update the object function or other optimizable quantities. Adorym currently provides 4 built-in optimizers: gradient descent (GD), momentum gradient descent  [53] , adaptive momentum estimation (Adam)  [54] , and conjugate gradient (CG)  [55]. Moreover, Adorym also has a ScipyOptimizer class that wraps the optimize. minimize module of the SciPy library  [50] , so that users may access more optimization algorithms coming with SciPy when using the Autograd backend on CPU.
More details about these optimizers can be found in the supplementary materials. Adorym supports parallelized processing based on the message passing interface (MPI)  [27] , which allows the software to spawn multiple processes using different GPUs, or many nodes on an HPC. Parallel processing based on MPI can be implemented in several different ways, each of which differs from others in terms of computational overhead and memory consumption. On the most basic level, Adorym allows users to run in its data parallelism (DP) mode, where each MPI rank saves a full copy of the object function and all other parameters  [28]. Before updating the parameters, the gradients are averaged over all ranks. While the DP mode is low in overhead, it has high memory consumption. This in turn limits the ability to reconstruct objects when one has limited memory resources.
Computing platforms This section involves several different computing platforms, on which Adorym or other referenced packages were run: • The machine "Godzilla" is a HP Z8 G4 workstation with two Intel Xeon Silver 4108 CPUs (8 cores each), 768 GB DDR4 RAM, one NVIDIA P4000 GPU (8 GB), a 256 GB solid state drive for the Red Hat Enterprise Linux 7 operating system and swap files, and a 18-TB, 3-drive RAID 5 disk array. • The machine "Blues" is an HPC system at Argonne's Laboratory Computing Resource Center (LCRC). It includes 300 nodes equipped with 16-core Intel Xeon E5-2670 CPUs (Sandy Bridge architecture), and 64 GB of memory per node. • The machine "Cooley" is an HPC system at the Argonne Leadership Computing Facility (ALCF). It has 126 compute nodes with Intel Haswell architecture. Each node has two 6-core, 2.
4-GHz Intel E5-2620 CPUs, and NVIDIA Tesla K80 dual GPUs. • The machine "Theta" is a HPC system at the Argonne Leadership Computing Facility (ALCF). This Cray XC40 system uses the Aries Dragonfly interconnect for inter-node communication  [59]. Each node of Theta possesses a 64-core Intel Xeon Phi processor (Intel KNL 7230) and 192 GB DDR4 RAM. An additional 16 GB multi-channel dynamic RAM (MCDRAM) is also available with each node; this is used as the last-level cache between L2 and DDR4 memory in our case. Up to 4392 nodes are available, though we used no more than 256 in the work reported here. The storage system of Theta uses the Lustre parallel file system, which allows data to be striped among 56 of its object storage targets (OSTs). This system was used to analyze the charcoal dataset shown in Fig.
The TV regularizer weighting hyperparameter was set to γ = 0. 01, since higher weightings resulted in "blocky" looking reconstructions with significant loss of high-frequency information. From the results shown in Fig. 7 , we can see that the Poisson loss function leads to the best visual appearance for both fluence levels. The addition of the TV term reduces the contrast of crosstalk artifacts between phase and magnitude, but it also affects high-spatial-frequency features. For distance refinement under noisy imaging conditions, LSQ+TV yielded the worst performance: the reconstruction from dataset with n = 4000 total photons/pixel ended up with refined distances of z = 37. 8, 45. 2, 107. 1, and 116. 1 cm. The average distance error of LSQ+TV at n = 400 is about 20% lower than that with n = 4000, which is counterintuitive.
We used Adorym to reconstruct a MDH dataset of a battery electrode that contained porous lithium peroxide (Li 2 O 2 ) formed as the product of a cathodic reaction. The sample was prepared following the procedure used for a transmission x-ray microscope study of the same type of materials  [65]. The MDH data were collected at the ID16B beamline of the European Synchrotron Radiation Facility (ESRF) using a beam energy of 29. 6 keV and a point-projection microscope setup. The source-to-detector distance was fixed at about 75 cm, and holograms were collected at four sample-to-detector distances so as to minimize zero-crossings in the CTF phase retrieval equation  [61]. We used only three of the four holograms for our Adorym reconstruction in order to challenge it with reduced information redundancy.
This produces a modified Airy pattern at the focus, and a ring-shaped illumination pattern at far upstream and downstream planes. The detector was placed 1. 75 m downstream the sample, which resulted in a sample-plane pixel size of 13. 2 nm. A 70 × 70 scan grid with a step size about 48 nm was used to collect 4900 diffraction patterns in fly-scan mode, each with an exposure time of 50 ms. A Dectris Eiger 500K detector was used to collect the diffraction patterns, and all images were cropped to 256 × 256 pixels before reconstruction. This dataset included deliberate errors in illumination probe positions for a demonstration of position refinement using an established approach  [72]. We used Adorym on the workstation "Godzilla" (Sec. 3. 1) to reconstruct this dataset to yield an object of 618 × 606 × 1 pixels, adding 50 pixels on each side to accommodate specimen regions that were illuminated by the tails of the probe.
2D multislice ptychography Adorym can also handle a mixture of near-field and far-field propagation in the forward model. While we have shown that automatic differentiation can be used for multislice ptychotomography  [14] , we show here the simpler case of multislice ptychography of reconstructing several planes at different distances from the probe focus using data collected from a single viewing angle  [8, 35]. We term it "sparse multislice ptychography" to distinguish it from the multislice ptychotomography in  [14]  which reconstructs a dense and continuous object. For validation of our approach, we used a dataset that has already been analyzed using SMP  [73]. The specimen is of Au and Ni nanoflakes on two sides of a 10 µm thick silicon window (the silicon window was largely transparent at the 12 keV photon energy used).
The ptychography dataset consisted of 1414 128 × 128 diffraction patterns acquired using a 12 nm FWHM beam focus from a multilayer Laue lens (MLL), with the specimen located 20 µm downstream of the focus (the depth of focus for this optic of 3. 9 µm). The sample plane pixel size is 7. 3 nm. The object shape in Adorym was 501 × 500 × 2, where the last dimension represents the number of slices. In previous work, the probe function reconstructed from a  ). An alternative approach without finite support is to impose sparsity by incorporating a reweighted l 1 -norm regularizer leading to images (g) and (h); in these images, crosstalk is suppressed at the cost of degrading the contrast and sharpness of the reconstructed images. ptychographic dataset with only a gold particle in the field of view was used as the initial probe function  [73] ; with Adorym, we used the inverse Fourier transform of the average magnitude from all diffraction patterns to initialize the probe function.
For this particular sample with known differences in material between the two planes, one can use x-ray fluorescence maps acquired simultaneously with the ptychography data to greatly reduce this crosstalk  [74]. We employed an approach in Adorym of creating finite support constraints based on the x-ray fluorescence images. We first convolved the x-ray fluorescence images (Au L α for slice 1, and Ni K α for slice 2) with a Gaussian with σ = 5 pixels or about 36. 5 nm, and then creating a binary mask by thresholding the XRF maps using a value determined through k-means clustering  [75]  implemented in the SciPy package  [50]. We also used the XRF maps to generate the initial guess for the object function. For this, the XRF images were normalized to their maxima, and multiplied with an approximate phase shifting value estimated from the refractive indices of Au and Ni.
This data was acquired using the As in a previouslyreported reconstruction of this dataset  [76] , this phosphorus reconstruction used refinement of the tomographic tilt angles, leading to angular corrections about all three axes as shown in (c). These refined angles were then employed in a subsequent ptychotomography reconstruction, yielding a 3D volume rendered in (d). Sub-images in (e) show optical sections from the reconstructed volume cut at indicated z-positions after it is rotated about the y-axis by 30 •. In (f), the power spectra of the reconstructions in the x-, y-, and z-direction are shown. For each case, two lines with the same color are fitted respectively using datapoints with spatial frequency in the range of 0. 008-0. 31f Ny and 0. 47-1. 0f Ny. As the latter fits the noise plateau, the intersection between both lines (marked by dotted vertical lines) provides a measure of spatial resolution.
Conventional tomography on HPC Adorym's optimization framework can also work with conventional tomography. When using the LSQ loss function and GD optimizer, Adorym's tomography reconstruction is equivalent to the basic algebraic reconstruction technique (ART)  [1] , but more advanced optimizers like Adam can be used to accelerate the reconstruction. The tomographic data to be reconstructed was an activated charcoal dataset  [83]. The original data were collected at the APS 32-ID beamline using a beam energy of 25 keV, filtered using a crystal monochromator, and the images were recorded by a CMOS camera (1920 × 1200 GS3-U3-23S6M-C) after the x-ray beam was converted into visible light by a LuAG:Ce scintillator. This resulted in a sample-plane pixel size of 600 nm. Since the size of the pellet (about 4 mm in diameter) was larger than the detector's field of view, full rotation sets were taken with the beam located at different offsets from the center of rotation in a Tomosaic approach  [83].
However, the runtime penalties are not necessarily unacceptably high. In the case of multislice x-ray ptychotomography of a 256 3 voxel simulated object that extends beyond the depth-of-focus limit, a C code with manually derived gradients took 6. 48 core hours per illumination angle to arrive at a solution  [13]  using the HPC system "Blues" (Sec. 3. 1), while a Python code using TensorFlow for the AD implementation  [14]  took 8. 25 core hours for a similar reconstruction step using the CPUs only on the HPC system "Cooley" (Sec. 3. 1). This may be in part due to AD's "cheap derivative principle"  [21] , where the cost of evaluating the gradient with reverse-mode AD is generally bound to small multiple of the cost needed to evaluate the forward model. Moreover, well-developed AD libraries can incorporate low-level optimizations, which can help them relative to basic manual differentiation implementations.
For example, when working with GPUs, PyTorch uses the CUDA stream mechanism to queue on-device instructions to the GPU's command buffer, so that tensor operations on GPU can be concurrent with Python interpretation on CPU  [48]. The most effective way to accelerate image reconstruction computations is to increase the degree of parallelization and improve interprocess communication -a principle that applies to both AD and manually coded implementations. Finally, it is known that interpreted languages like Python and MATLAB might have inferior execution speeds compared to compiled languages, but the advent of just-in-time (JIT) compilers  [89]  is likely to change the situation. We are aware of a few AD libraries which are already using JIT, such as JAX  [90] ; meanwhile, efforts on incorporating JIT support into PyTorch are also ongoing  [88] , which Adorym can gain from when it becomes available.
We describe and demonstrate an optimization-based x-ray image reconstruction framework called Adorym. Our framework provides a generic forward model, allowing one code framework to be used for a wide range of imaging methods ranging from near-field holography to and fly-scan ptychographic tomography. By using automatic differentiation for optimization, Adorym has the flexibility to refine experimental parameters including probe positions, multiple hologram alignment, and object tilts. It is written with strong support for parallel processing, allowing large datasets to be processed on high-performance computing systems. We demonstrate its use on several experimental datasets to show improved image quality through parameter refinement. 1.
Modules and components As noted in Section 2 of the main manuscript, Adorym is written in a modular and object-oriented programming style, consisting primarily of the following classes: • The ForwardModel class discussed in Sec. 1. 4, which contains the forward model corresponding to a particular imaging method. • The Optimizer class discussed in Sec. 1. 6, which provides options on what optimization method to use for minimizing the loss function L. • The LargeArray class discussed in Sec. 1. 2, which manages the large array of the object, or x. • The propagate class discussed in Sec. 1. 3, which handles wavefield propagation for those forward models that require it. • The wrapper module that provides a common interface for functions in the two AD engines provided: Autograd, and PyTorch. Modules like ForwardModel and Optimizer each contain several child classes, providing support for different types of imaging techniques or setups, numerical optimization algorithms, distributed computation methods, and automatic differentiation backends (and computation devices, namely CPU and GPU).
Data format Because of its ability to contain tagged scalar and array data, as well as its support for parallel access, Adorym uses HDF5 files  [1]  for input and output as noted in Sec. 2. 1 of the main manuscript. Acquired images are saved as a 4D dataset data under the exchange group  [2] , and metadata such as beam energy, probe position, and propagation distances are stored under the metadata group. In compliance with the ptychography module of Adorym, data should have a shape of [num_angles, num_tiles, len_detector_y, len_detector_x], where num_tiles can be the (maximum) number of diffraction spots per angle in the case of ptychography or ptychotomography, or the number of subdivided image "tiles" per angle in the case of full-field imaging; the latter will be explained in more details later in this section (Fig.
2 ). This is a general data format, and is compatible towards more specific imaging types: for example, 2D ptychography has num_angles = 1 and num_tiles > 1, while full-field tomography has num_tiles = 1 and num_angles > 1. In the case of multi-distance holography (MDH) where in-line holograms of the object at difference sample-to-detector distances are acquired to provide additional information for phase retrieval  [3] , holograms collected from the same viewing angle but different defocus distances are treated as different tiles -i. e. , they are contiguous along the second (num_tiles) dimension. When dealing with full-field data from large detector arrays, Adorym provides a script to divide each image into several subblocks called "tiles. " It follows that the divided image data can be treated in a way just like ptychography, where only a small number of these tiles are processed each time.