## 6 Technical Details about the Implementation  
In this section, technical details about the implementation are given. The first implementation has been developed in Java 11. Several explainer videos and the source code can be watched and downloaded from the official web page of this paper (youractionsdefineyou.com/videogeneratorhopfield/, accessed on 19 June 2021). The complete implementation is summarized using UML diagrams (see Figure 9). The implementation is formed by two packages: Hopfield neuronal network and video generation. The first one implements all the functionality required to execute the HNN (training and pattern recognition). The execution of an HNN consists of performing three steps: (i) to receive as input an array of \(1\) and \(-1\) (the pattern); (ii) to train the HNN for recognizing this pattern; and (iii) to recognize any array received as input. This package has a class called ExecutionTrace for storing all the information about the HNN execution. The result is a structured file containing a sequence of rows with information about the execution. Each row is formed by an identifier (ID) that indicates the order in which a row must be generated; a label action (LABEL_ACTION) gives us information about which operation was performed (initialization, creation neurons, creation connections, creation neural networks, weights update, so on). After that, a set of values D1;...; DN is provided with information about the results obtained after the execution of the action indicated previously. Finally, a set of messages about each \(D_{i}\) could be also indicated to support the process of the video generation. ID0;Label_Action;D1; D2;...;DN; M1;...;MN;  
ID1;Label_Action;D1; D2;...;DM; M1;...;MM;  
...  
ID1;Label_Action;D1; D2;...;DL; M1;...;ML;  
The video-generation package implements the functionality needed to generate an explainer video from the information created by the execution trace package. The main classes are CSV2 Frame, FrameCreator, First-Order Representation, Second-Order Representation and VideoGenerator. The main Algorithm A1 receives as input an execution trace (list of rows) and returns a video in mp4. It reads one by one each line and creates a slide using the information associated with each row calling to the function Create-Slide(row[]) (Algorithm A1-line 5 in Appendix A). The function Create-Slide(row[]) creates an empty slide, and it will call a sequence of functions whose objective is to create, where appropriate, a frame with visual and textual explanations. The mentioned functions are:  
Figure 8: Storytelling pipeline. The first and second functions generate visual representations from the information received as parameters. The third function generates textual explanations from the visual ones. It is important to mention that sometimes we do not employ this function in the current implementation, but it will be an essential resource of explainability in the future. The Algorithm A2 shows a pseudocode to create a new frame and Algorithm A3 shows how we implement the function first-order-representations. As we can observe this function creates a frame depending on the action received as parameter. For example, we explain here two of them: a simple one (images-text(pattern,info)); and a more complex one (images-text(iteration,info)) which is called complete cycle of representation (see Appendix B for more details). The function images-text(pattern,info) generates an explainer frame about the input pattern from an array of information info[] that contains the explanations generated to explain the data structures employed to implement this element. This function uses 2D atomic primitives to show the messages and create a graphical representation of the input pattern. The Figure 10 graphically explains this process. Sometimes atomic primitives are not enough to implement a particular graphical representation, and we need to create additional functions.