## 3 Numerical Simulations Using the ANN Flow Law
### Numerical Implementation of the ANN Flow Law  
In order to have a better understanding of the implementation of the VUHARD subroutine, we are going to detail the computation of the flow stress and the three derivatives in one step as a function of the triplet of input values \(\varepsilon\), \(\dot{\varepsilon}\), \(T\). We suppose that the current input is stored in a three components vector \(\overrightarrow{\xi}^{T}=[\varepsilon,\log(\dot{\varepsilon}/\dot{\varepsilon} _{0}),T]\). We also suppose that  
Figure 7: Comparison of the provided ANN results during an out of range computation.  
the minimum and range values of the inputs, used during the learning phase, are stored in two vectors \(\overrightarrow{\xi}_{0}\) and \(\Delta\overrightarrow{\xi}\), respectively.
* We first use Equation (11) to compute the vector \(\overrightarrow{\chi}\) where all components of \(\overrightarrow{\xi}\) will be remapped within the range \([0,1]\): \[\overrightarrow{x}=\left(\overrightarrow{\xi}-\overrightarrow{\xi}_{0}\right) \oslash\Delta\overrightarrow{\xi},\] (16) where \(\oslash\) is the Hadamard division operator.
* Conforming to Equation (2), we compute the vector: \[\overrightarrow{y}_{[1]}=\mathsf{w}_{[1]}\cdot\overrightarrow{x}+ \overrightarrow{b}_{[1]}.\] (17)
* Then, from Equation (3) and the expression of the activation function in the first layer and defined by one of the Equations (5)-(10), we compute the vector: \[\overrightarrow{y}_{[1]}=f_{[1]}(\overrightarrow{y}_{[1]}).\] (18)
* We repeat the process for the second layer, so that we compute the vectors: \[\overrightarrow{y}_{[2]}=\mathsf{w}_{[2]}\cdot\overrightarrow{y}_{[1]}+ \overrightarrow{b}_{[2]},\] (19) and: \[\overrightarrow{y}_{[2]}=f_{[2]}(\overrightarrow{y}_{[2]}).\] (20)
* From Equations (4) and (12), we compute the flow stress \(\sigma\) using the following equation: \[\sigma=\Delta\sigma\cdot\left(\overrightarrow{w}^{T}\cdot\overrightarrow{y} _{[2]}+b\right)+\sigma_{0}.\] (21)
* Then, we can compute in a single step the three derivatives \(\overrightarrow{\sigma}^{\prime}\) from Equation (13) with the following expression: \[\overrightarrow{\sigma}^{\prime} =\Delta\sigma\cdot\mathsf{w}_{[1]}^{T}\cdot\left[\left(\mathsf{ w}_{[2]}^{T}\cdot\left(\overrightarrow{w}^{T}\circ f^{\prime}(\overrightarrow{y}_{[2]}) \right)\right)\circ f^{\prime}(\overrightarrow{y}_{[1]})\right]\oslash\Delta \overrightarrow{\xi}\enspace,\] (22) \[\begin{array}{l}\sigma_{2}^{\prime}:=\sigma_{2}^{\prime}/\xi\end{array}\] where the expression used for \(f^{\prime}()\) changes depending on the activation function used.  
As an illustration the corresponding implementation using Python of those equations is proposed in Appendix A. A dedicated Python program is used to translate those equations into a Fortran 77 subroutine. During the translation phase, all functions corresponding to array operators, as matrix-matrix multiplications or element-wise operations, are converted into unrolled loops (explicitly written), all values of the ANNs parameters are explicitly written as data at the beginning of the subroutine, so that the a 3-15-7-1-exp Fortran routine consist of more than 400 lines of code. A small extract of the corresponding VUHARD subroutine is presented in Figure A2 in Appendix B. All full source files of the six VUHARD subroutines is available in the Software Heritage Archive [36].  
The Fortran subroutine is compiled with double precision directive using the Intel Fortran 14.0.2 compiler on a Ubuntu 22.04 server and linked to the main Abaqus explicit executable.