Popis: |
Statistični model v jeziku Stan lahko prevedemo tako, da se izvaja ali na centralni procesni enoti ali na grafični procesni enoti. Napačna izbira naprave lahko močno podaljša čas obdelave. V našem pristopu napravo izbiramo sproti in ob tem učimo odločitveno metodo. Pripravili in preizkusili smo tri take odločitvene metode. Metode se prilagodijo na strojno opremo in odločajo glede na velikost primerka računskega problema. V delu predstavimo programsko arhitekturo, ki omogoča uvedbo funkcij z vgrajenim odločanjem z majhnimi spremembami obstoječe kode. Odločitvene metode smo preizkusili z merjenjem časa izvajanja matematičnih operacij in realnega primera statističnega modela. Odločitvena metoda LinUCB je v vsakem preizkusu dosegla primerljiv ali krajši čas izvajanja, kot na vnaprej izbrani napravi. S predhodnim učenjem odločitvene metode, četudi na manjših primerkih, smo čase izvajanja še skrajšali. Statistical models made in Stan can execute on a central processing unit or a graphical processing unit. Incorrect choice of the device can significantly extend execution time. Our approach chooses the executing device and trains the decision method during program execution. We implemented and tested three such decision methods. The methods adjust to present hardware and make decisions based on the size of the problem instances. We offer a programming architecture, which allows for easy construction of functions with built-in decision methods. We tested the methods by measuring execution times of selected mathematical operations and a realistic statistical model. In every test case, the LinUCB decision method achieved a similar or shorter execution time than the methods with a device selected in advance. We further reduced execution time by training the decision method ahead of time, despite training instances being smaller than those used for testing. |