# Makedonka: Applied Deep Learning Model for Text-to-Speech Synthesis in Macedonian Language
## 4 Results  
To achieve single-speaker synthesis, approximately 20 h of Macedonian high-quality speech audio dataset recorded at a sample rate of 22.5 kHz was used. The training was performed by using NVIDIA Tesla P100 with 16 GB RAM. The total training time by using a batch size of 16 took 21 days and 16 h. The training was completed after 620K steps. Figure 3 presents the attention changing during the training process. The model started to produce an intelligible, understandable, and partially human-like speech after 50 K steps, as observed from the figure. Hereafter, the model started to improve itself by loosing the \"robotic\" component in the synthesized speech and achieved completely human-like speech until the end of the training. At each checkpoint, the model was evaluated on seven different sentences that are carefully chosen to be specific in order to test the ability of the models. By the term specific, it means that the examples cover special cases in the Macedonian language, such as: long words; compound words; comma somewhere in the sentence to check whether the model makes the appropriate pause when synthesizes the speech; sentences ending with fullstop, question mark, and exclamation mark to check whether the model is able to change the intonation in the synthesized speech; and, tongue twisters, and tongue twisters containing words with multiple adjacent consonants, such as the word \"Shtrk\". The audio files from the synthesized speech across the checkpoints are available on GitHub [[https://f-data.github.io/TTS/](https://f-data.github.io/TTS/)]([https://f-data.github.io/TTS/](https://f-data.github.io/TTS/)). \begin{table}
\begin{tabular}{l l} \hline \hline \multicolumn{1}{c}{**Hyperparameters**} \\ \hline “replace\_pronunciation\_prob”: 0.0, & “converter\_channels”: 256, \\ “speaker\_embed\_dim”: 16, & “query\_position\_rate”: 1.0, \\ “num\_mels”: 80, & “key\_position\_rate”: 1.385, \\ “fmin”: 125, & “num\_workers”: 2, \\ “fmax”: 7600, & “masked\_loss\_weight”: 0.5, \\ “fft\_size”: 1024, & “priority\_freq”: 3000, \\ “hop\_size”: 256, & “priority\_freq\_weight”: 0.0, \\ “sample\_rate”: 22050, & “binary\_divergence\_weight”: 0.1, \\ “preremphasis”: 0.97, & “guided\_attention\_sigma”: 0.2, \\ “min\_level\_db”: - 100, & “batch\_size”: 32, \\ “ref\_level\_db”: 20, & “adam\_beta1”: 0.5, \\ “rescaling\_max”: 0.999, & “adam\_beta2”: 0.9, \\ “downsample\_step”: 4, & “adam\_eps”: 0.000006, \\ “outputs\_per\_step”: 1, & “initial\_learning\_rate”: 0.0005, \\ “embedding\_weight\_std”: 0.1, & “nepochs”: 2000, \\ “speaker\_embedding\_weight\_std”: 0.01, & “weight\_decay”: 0.0, \\ “padding\_idx”: 0, & “clip\_thresh”: 0.1, \\ “max\_positions”: 512, & “checkpoint\_interval”: 1000, \\ “dropout”: 0.050000000000044, & “eval\_interval”: 10000, \\ “kernel\_size”: 3, & “window\_ahead”: 3, \\ “text\_embed\_dim”: 256, & “window\_backward”: 1, \\ “encoder\_channels”: 512, & “power”: 1.4 \\ “decoder\_channels”: 256, & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Model’s hyperparameters settings. Figure 4 presents the metrics that speak of the performance of the training models. Loss function is a metric that refers to the accuracy of the prediction. The main objective is to minimize the model errors or minimize the loss function. Thus, the Deep learning algorithm will repeat as many times needed in order the loss to reach as flatter line shape as possible. In our case, the loss functions behaves in a desired manner, it gradually decreases, converging to a value of 0.1731 after 162.2 K steps in four days and \(11\) h of training. Learning rate plays a vital role in minimizing the loss function. It dictates the speed at which we want our model to learn. This value must be set properly, since if not, for example, setting it too high, the model will not have time to learn anything and, thus, the results will be poor. The initial learning rate was set to 0.0005, as shown in Table 1. After four days and 5 h of training, or 151.2 K steps, it decreases to a value of 0.000081335.