praat_HMM_init.cpp 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. /* praat_HMM_init.cpp
  2. *
  3. * Copyright (C) 2010-2011,2015-2016 David Weenink
  4. *
  5. * This code is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "praat.h"
  19. #include "GaussianMixture.h"
  20. #include "HMM.h"
  21. #include "Strings_extensions.h"
  22. #include "TableOfReal.h"
  23. #define GaussianMixture_OPTION_MENU_CRITERIA \
  24. OPTIONMENU (criterion, U"Criterion based on", 1) \
  25. OPTION (U"Likelihood") \
  26. OPTION (U"Message length") \
  27. OPTION (U"Bayes information") \
  28. OPTION (U"Akaike information") \
  29. OPTION (U"Akaike corrected") \
  30. OPTION (U"Complete-data ML")
  31. DIRECT (HELP_GaussianMixture_help) {
  32. HELP (U"GaussianMixture")
  33. }
  34. FORM (GRAPHICS_GaussianMixture_drawConcentrationEllipses, U"GaussianMixture: Draw concentration ellipses", U"GaussianMixture: Draw concentration ellipses...") {
  35. POSITIVE (numberOfSigmas, U"Number of sigmas", U"1.0")
  36. BOOLEAN (principalComponentPlane, U"Principal component plane", true)
  37. INTEGER (xDimension, U"X-dimension", U"1")
  38. INTEGER (yDimension, U"Y-dimension", U"2")
  39. REAL (xmin, U"left Horizontal range", U"0.0")
  40. REAL (xmax, U"right Horizontal range", U"0.0")
  41. REAL (ymin, U"left Vertical range", U"0.0")
  42. REAL (ymax, U"right Vertical range", U"0.0")
  43. INTEGER (labelSize, U"Label size", U"12")
  44. BOOLEAN (garnish, U"Garnish", true)
  45. OK
  46. DO
  47. GRAPHICS_EACH (GaussianMixture)
  48. GaussianMixture_drawConcentrationEllipses (me, GRAPHICS, numberOfSigmas, 0, 0, principalComponentPlane, xDimension, yDimension, xmin, xmax, ymin, ymax, labelSize, garnish);
  49. GRAPHICS_EACH_END
  50. }
  51. FORM (GRAPHICS_GaussianMixture_PCA_drawConcentrationEllipses, U"GaussianMixture & PCA: Draw concentration ellipses", U"GaussianMixture & PCA: Draw concentration ellipses...") {
  52. POSITIVE (numberOfSigmas, U"Number of sigmas", U"1.0")
  53. INTEGER (xDimension, U"X-dimension", U"1")
  54. INTEGER (yDimension, U"Y-dimension", U"2")
  55. REAL (xmin, U"left Horizontal range", U"0.0")
  56. REAL (xmax, U"right Horizontal range", U"0.0")
  57. REAL (ymin, U"left Vertical range", U"0.0")
  58. REAL (ymax, U"right Vertical range", U"0.0")
  59. INTEGER (labelSize, U"Label size", U"12")
  60. BOOLEAN (garnish, U"Garnish", true)
  61. OK
  62. DO
  63. GRAPHICS_TWO (GaussianMixture, PCA)
  64. GaussianMixture_PCA_drawConcentrationEllipses (me, you, GRAPHICS, numberOfSigmas, 0, nullptr, xDimension, yDimension, xmin, xmax, ymin, ymax, labelSize, garnish);
  65. GRAPHICS_TWO_END
  66. }
  67. FORM (GRAPHICS_GaussianMixture_drawMarginalPdf, U"GaussianMixture: Draw marginal pdf", U"GaussianMixture: Draw marginal pdf...") {
  68. INTEGER (xDimension, U"X-dimension", U"1")
  69. REAL (xmin, U"left Horizontal range", U"0.0")
  70. REAL (xmax, U"right Horizontal range", U"0.0")
  71. REAL (ymin, U"left Vertical range", U"0.0")
  72. REAL (ymax, U"right Vertical range", U"0.0")
  73. NATURAL (numberOfPoints, U"Number of points", U"500")
  74. INTEGER (numberOfBins, U"Number of bins", U"0.0")
  75. BOOLEAN (garnish, U"Garnish", true)
  76. OK
  77. DO
  78. GRAPHICS_EACH (GaussianMixture)
  79. GaussianMixture_drawMarginalPdf (me, GRAPHICS, xDimension, xmin, xmax, ymin, ymax, numberOfPoints, numberOfBins, garnish);
  80. GRAPHICS_EACH_END
  81. }
  82. DIRECT (INTEGER_GaussianMixture_getNumberOfComponents) {
  83. INTEGER_ONE (GaussianMixture)
  84. integer result = my numberOfComponents;
  85. INTEGER_ONE_END (U"(= number of components)")
  86. }
  87. DIRECT (INTEGER_GaussianMixture_getDimensionOfComponent) {
  88. INTEGER_ONE (GaussianMixture)
  89. integer result = my dimension;
  90. INTEGER_ONE_END (U"(= dimension of component)")
  91. }
  92. FORM (REAL_GaussianMixture_getProbabilityAtPosition, U"GaussianMixture: Get probability at position", nullptr) {
  93. SENTENCE (position_string, U"Position", U"100.0 300.0")
  94. OK
  95. DO
  96. NUMBER_ONE (GaussianMixture)
  97. double result = GaussianMixture_getProbabilityAtPosition_string (me, position_string);
  98. NUMBER_ONE_END (U" (= probability at position ", position_string, U")")
  99. }
  100. FORM (MODIFY_GaussianMixture_splitComponent, U"GaussianMixture: Split component", U"GaussianMixture: Split component...") {
  101. NATURAL (component, U"Component", U"1")
  102. OK
  103. DO
  104. MODIFY_EACH (GaussianMixture)
  105. GaussianMixture_splitComponent (me, component);
  106. MODIFY_EACH_END
  107. }
  108. FORM (GRAPHICS_GaussianMixture_PCA_drawMarginalPdf, U"GaussianMixture & PCA: Draw pdf function", U"GaussianMixture: Draw marginal pdf...") {
  109. INTEGER (xDimension, U"X-dimension", U"1")
  110. REAL (xmin, U"left Horizontal range", U"0.0")
  111. REAL (xmax, U"right Horizontal range", U"0.0")
  112. REAL (ymin, U"left Vertical range", U"0.0")
  113. REAL (ymax, U"right Vertical range", U"0.0")
  114. NATURAL (numberOfPoints, U"Number of points", U"500")
  115. INTEGER (numberOfBins, U"Number of bins", U"0.0")
  116. BOOLEAN (garnish, U"Garnish", true)
  117. OK
  118. DO
  119. GRAPHICS_TWO (GaussianMixture, PCA)
  120. GaussianMixture_PCA_drawMarginalPdf (me, you, GRAPHICS, xDimension, xmin, xmax, ymin, ymax, numberOfPoints, numberOfBins, garnish);
  121. GRAPHICS_TWO_END
  122. }
  123. FORM (NEW1_GaussianMixture_PCA_to_Matrix_density, U"GaussianMixture & PCA: To Matrix density", U"GaussianMixture & PCA: To Matrix (density)...") {
  124. INTEGER (xDimension, U"X-dimension", U"1")
  125. INTEGER (yDimension, U"Y-dimension", U"2")
  126. REAL (xmin, U"left Horizontal range", U"0.0")
  127. REAL (xmax, U"right Horizontal range", U"0.0")
  128. NATURAL (numberOfColumns, U"Number of columns", U"100")
  129. REAL (ymin, U"left Vertical range", U"0.0")
  130. REAL (ymax, U"right Vertical range", U"0.0")
  131. NATURAL (numberOfRows, U"Number of rows", U"100")
  132. OK
  133. DO
  134. CONVERT_TWO (GaussianMixture, PCA)
  135. autoMatrix result = GaussianMixture_PCA_to_Matrix_density (me, you, xDimension, yDimension, xmin, xmax, numberOfColumns, ymin, ymax, numberOfRows);
  136. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  137. }
  138. FORM (NEW_GaussianMixture_extractComponent, U"GaussianMixture: Extract component", nullptr) {
  139. NATURAL (component, U"Component", U"1")
  140. OK
  141. DO
  142. CONVERT_EACH (GaussianMixture)
  143. autoCovariance result = GaussianMixture_extractComponent (me, component);
  144. CONVERT_EACH_END (my name.get())
  145. }
  146. DIRECT (NEW_GaussianMixture_extractCentroids) {
  147. CONVERT_EACH (GaussianMixture)
  148. autoTableOfReal result = GaussianMixture_extractCentroids (me);
  149. CONVERT_EACH_END (my name.get())
  150. }
  151. DIRECT (NEW_GaussianMixture_extractMixingProbabilities) {
  152. CONVERT_EACH (GaussianMixture)
  153. autoTableOfReal result = GaussianMixture_extractMixingProbabilities (me);
  154. CONVERT_EACH_END (my name.get())
  155. }
  156. DIRECT (NEW_GaussianMixture_to_PCA) {
  157. CONVERT_EACH (GaussianMixture)
  158. autoPCA result = GaussianMixture_to_PCA (me);
  159. CONVERT_EACH_END (my name.get())
  160. }
  161. FORM (NEW_GaussianMixture_to_TableOfReal_randomSampling, U"GaussianMixture: To TableOfReal (random sampling)", U"GaussianMixture: To TableOfReal (random sampling)...") {
  162. NATURAL (numberOfPoints, U"Number of data points", U"100")
  163. OK
  164. DO
  165. CONVERT_EACH (GaussianMixture)
  166. autoTableOfReal result = GaussianMixture_to_TableOfReal_randomSampling (me, numberOfPoints);
  167. CONVERT_EACH_END (my name.get())
  168. }
  169. DIRECT (NEW_GaussianMixture_to_Covariance_between) {
  170. CONVERT_EACH (GaussianMixture)
  171. autoCovariance result = GaussianMixture_to_Covariance_between (me);
  172. CONVERT_EACH_END (my name.get(), U"_b")
  173. }
  174. DIRECT (NEW_GaussianMixture_to_Covariance_within) {
  175. CONVERT_EACH (GaussianMixture)
  176. autoCovariance result = GaussianMixture_to_Covariance_within (me);
  177. CONVERT_EACH_END (my name.get(), U"_w");
  178. }
  179. DIRECT (NEW_GaussianMixture_to_Covariance_total) {
  180. CONVERT_EACH (GaussianMixture)
  181. autoCovariance result = GaussianMixture_to_Covariance_total (me);
  182. CONVERT_EACH_END (my name.get(), U"_t");
  183. }
  184. FORM (REAL_GaussianMixture_TableOfReal_getLikelihoodValue, U"GaussianMixture & TableOfReal: Get likelihood value",
  185. U"GaussianMixture & TableOfReal: Get likelihood value...") {
  186. GaussianMixture_OPTION_MENU_CRITERIA
  187. OK
  188. DO
  189. NUMBER_TWO (GaussianMixture, TableOfReal)
  190. conststring32 criterionText = GaussianMixture_criterionText (criterion);
  191. double lnpdn = GaussianMixture_TableOfReal_getLikelihoodValue (me, you, criterion - 1);
  192. double result = lnpdn / you -> numberOfRows;
  193. NUMBER_TWO_END (U" (= ", criterionText, U", n = ", you -> numberOfRows, U")")
  194. }
  195. DIRECT (HELP_HMM_help) {
  196. HELP (U"HMM")
  197. }
  198. FORM (NEW1_HMM_create, U"Create HMM", nullptr) {
  199. WORD (name, U"Name", U"hmm")
  200. BOOLEAN (leftToRightModel, U"Left to right model", false)
  201. NATURAL (numberOfStates, U"Number of states", U"3")
  202. NATURAL (numberOfObservations, U"Number of observations", U"3")
  203. OK
  204. DO
  205. CREATE_ONE
  206. autoHMM result = HMM_create (leftToRightModel, numberOfStates, numberOfObservations);
  207. CREATE_ONE_END (name)
  208. }
  209. FORM (NEW1_HMM_createSimple, U"HMM: Create simple", U"HMM: Create simple HMM...") {
  210. WORD (name, U"Name", U"weather")
  211. BOOLEAN (leftToRightModel, U"Left to right model", false)
  212. SENTENCE (states_string, U"States", U"Rainy Sunny")
  213. SENTENCE (observations_string, U"Observations", U"Walk Shop Clean")
  214. OK
  215. DO
  216. CREATE_ONE
  217. autoHMM result = HMM_createSimple (leftToRightModel, states_string, observations_string);
  218. CREATE_ONE_END (name)
  219. }
  220. FORM (NEW1_HMM_createContinuousModel, U"HMM: Create continuous model", nullptr) {
  221. WORD (name, U"Name", U"cm")
  222. BOOLEAN (leftToRightModel, U"Left to right model", false)
  223. NATURAL (numberOfStates, U"Number of states", U"3")
  224. NATURAL (numberOfSymbols, U"Number of symbols", U"10")
  225. LABEL (U"For the Gaussian mixtures:")
  226. NATURAL (numberOfComponents, U"Number of components", U"3")
  227. NATURAL (componentDimension, U"Dimension of component", U"39")
  228. OPTIONMENU (matricesType, U"Covariance matrices are", 1)
  229. OPTION (U"Complete")
  230. OPTION (U"Diagonal")
  231. OK
  232. DO
  233. Melder_require (matricesType >= 0 && matricesType <= componentDimension, U"Not a valid covariance matrix type");
  234. CREATE_ONE
  235. autoHMM result = HMM_createContinuousModel (leftToRightModel, numberOfStates, numberOfSymbols, numberOfComponents, componentDimension, matricesType - 1);
  236. CREATE_ONE_END (name)
  237. }
  238. FORM (NEW_HMMObservationSequence_to_HMM, U"HMMObservationSequence: To HMM", nullptr) {
  239. LABEL (U"(0 states gives a non-hidden model) ")
  240. INTEGER (numberOfHiddenStates, U"Number of hidden states", U"2")
  241. BOOLEAN (leftToRightModel, U"Left to right model", false)
  242. OK
  243. DO
  244. CONVERT_EACH (HMMObservationSequence)
  245. autoHMM result = HMM_createFromHMMObservationSequence (me, numberOfHiddenStates, leftToRightModel);
  246. CONVERT_EACH_END (my name.get(), U"_", numberOfHiddenStates)
  247. }
  248. FORM (GRAPHICS_HMM_draw, U"HMM: Draw", nullptr) {
  249. BOOLEAN (garnish, U"Garnish", false)
  250. OK
  251. DO
  252. GRAPHICS_EACH (HMM)
  253. HMM_draw (me, GRAPHICS, garnish);
  254. GRAPHICS_EACH_END
  255. }
  256. FORM (GRAPHICS_HMM_HMMStateSequence_drawTrellis, U"HMM & Strings: Draw trellis", nullptr) {
  257. BOOLEAN (connect, U"Connect", true);
  258. BOOLEAN (garnish, U"Garnish", true);
  259. OK
  260. DO
  261. GRAPHICS_TWO (HMM, HMMStateSequence)
  262. HMM_HMMStateSequence_drawTrellis (me, you, GRAPHICS, connect, garnish);
  263. GRAPHICS_TWO_END
  264. }
  265. DIRECT (GRAPHICS_HMM_drawForwardProbabilitiesIllustration) {
  266. autoPraatPicture picture;
  267. HMM_drawForwardProbabilitiesIllustration (GRAPHICS, true);
  268. END }
  269. DIRECT (GRAPHICS_HMM_drawBackwardProbabilitiesIllustration) {
  270. autoPraatPicture picture;
  271. HMM_drawBackwardProbabilitiesIllustration (GRAPHICS, true);
  272. END }
  273. DIRECT (GRAPHICS_HMM_drawForwardAndBackwardProbabilitiesIllustration) {
  274. autoPraatPicture picture;
  275. HMM_drawForwardAndBackwardProbabilitiesIllustration (GRAPHICS, true);
  276. END }
  277. FORM (REAL_HMM_getTransitionProbability, U"HMM: Get transition probability", U"HMM: Get transition probability...") {
  278. NATURAL (fromState, U"From state number", U"1")
  279. NATURAL (toState, U"To state number", U"1")
  280. OK
  281. DO
  282. NUMBER_ONE (HMM)
  283. Melder_require (fromState <= my numberOfStates && toState <= my numberOfStates, U"State number(s) too high.");
  284. double result = my transitionProbs [fromState] [toState];
  285. NUMBER_ONE_END (U" : [ ", fromState, U", ", toState, U" ]")
  286. }
  287. FORM (REAL_HMM_getEmissionProbability, U"HMM: Get emission probability", U"HMM: Get emission probability...") {
  288. NATURAL (fromState, U"From state number", U"1")
  289. NATURAL (toState, U"To state number", U"1")
  290. OK
  291. DO
  292. NUMBER_ONE (HMM)
  293. Melder_require (fromState <= my numberOfStates, U"State number too high.");
  294. Melder_require (toState <= my numberOfObservationSymbols, U"Symbol number too high.");
  295. double result = my emissionProbs[fromState][toState];
  296. NUMBER_ONE_END (U" : [ ", fromState, U", ", toState, U" ]")
  297. }
  298. FORM (REAL_HMM_getStartProbability, U"HMM: Get start probability", U"HMM: Get start probability...") {
  299. NATURAL (stateNumber, U"State number", U"1")
  300. OK
  301. DO
  302. NUMBER_ONE (HMM)
  303. Melder_require (stateNumber <= my numberOfStates, U"State number too high.");
  304. double result = my transitionProbs[0][stateNumber];
  305. NUMBER_ONE_END (U" : [ ", stateNumber, U" ]")
  306. }
  307. FORM (REAL_HMM_getProbabilityAtTimeBeingInState, U"HMM: Get probability of being in state at time",
  308. U"HMM: Get p (time, state)...") {
  309. NATURAL (timeIndex, U"Time index", U"10")
  310. NATURAL (stateNumber, U"State number", U"1")
  311. OK
  312. DO
  313. NUMBER_ONE (HMM)
  314. double result = HMM_getProbabilityAtTimeBeingInState (me, timeIndex, stateNumber);
  315. NUMBER_ONE_END (U" (= ln(p), p = ", Melder_naturalLogarithm (result), U") Being in state ", stateNumber, U" at time ", timeIndex)
  316. }
  317. FORM (REAL_HMM_getProbabilityAtTimeBeingInStateEmittingSymbol, U"HMM: get probability being at time in state emitting symbol", U"HMM: Get p (time, state, symbol)...") {
  318. NATURAL (timeIndex, U"Time index", U"10")
  319. NATURAL (stateNumber, U"State number", U"1")
  320. NATURAL (symbolNumber, U"Symbol number", U"1")
  321. OK
  322. DO
  323. NUMBER_ONE (HMM)
  324. double result = HMM_getProbabilityAtTimeBeingInStateEmittingSymbol (me, timeIndex, stateNumber, symbolNumber);
  325. NUMBER_ONE_END (U" (= ln(p), p = ", Melder_naturalLogarithm (result), U") Being in state ", stateNumber, U" emitting symbol ", symbolNumber, U" at time ", timeIndex)
  326. }
  327. FORM (REAL_HMM_getProbabilityOfStayingInState, U"HMM: Get probability of staying in state", U"HMM: Get probability staying in state...") {
  328. NATURAL (stateNumber, U"State number", U"1")
  329. NATURAL (numberOfTimeUnits, U"Number of time units", U"2")
  330. OK
  331. DO
  332. NUMBER_ONE (HMM)
  333. double result = HMM_getProbabilityOfStayingInState (me, stateNumber, numberOfTimeUnits);
  334. NUMBER_ONE_END (U"(probability of staying in state)")
  335. }
  336. FORM (REAL_HMM_getExpectedDurationInState, U"HMM: Get expected value of duration in state",
  337. U"HMM: Get expected duration in state...") {
  338. NATURAL (stateNumber, U"State number", U"1")
  339. OK
  340. DO
  341. NUMBER_ONE (HMM)
  342. double result = HMM_getExpectedValueOfDurationInState (me, stateNumber);
  343. NUMBER_ONE_END (U" time units")
  344. }
  345. FORM (INFO_HMM_getSymbolLabel, U"HMM: Get symbol label", nullptr) {
  346. NATURAL (symbolNumber, U"Symbol number", U"1")
  347. OK
  348. DO
  349. STRING_ONE (HMM)
  350. Melder_require (symbolNumber <= my numberOfObservationSymbols, U"Symbol number too high.");
  351. HMMObservation observation = my observationSymbols->at [symbolNumber];
  352. conststring32 result = observation -> label.get();
  353. STRING_ONE_END
  354. }
  355. FORM (INFO_HMM_getStateLabel, U"HMM: Get state label", nullptr) {
  356. NATURAL (stateNumber, U"State number", U"1")
  357. OK
  358. DO
  359. STRING_ONE (HMM)
  360. Melder_require (stateNumber <= my numberOfStates, U"State number too high.");
  361. HMMState state = my states->at [stateNumber];
  362. conststring32 result = state -> label.get();
  363. STRING_ONE_END
  364. }
  365. FORM (REAL_HMM_HMM_getCrossEntropy, U"HMM & HMM: Get cross-entropy...", U"HMM & HMM: Get cross-entropy...") {
  366. NATURAL (observationLength, U"Observation length", U"2000")
  367. BOOLEAN (symmetric, U"Symmetric", true)
  368. OK
  369. DO
  370. NUMBER_COUPLE (HMM)
  371. double result = HMM_HMM_getCrossEntropy (me, you, observationLength, symmetric);
  372. NUMBER_COUPLE_END (U" (= ", (symmetric ? U"symmetric " : U""), U" cross-entropy between models for observation length = ", observationLength, U")")
  373. }
  374. DIRECT (REAL_HMM_HMM_HMMObservationSequence_getCrossEntropy) {
  375. NUMBER_COUPLE_AND_ONE (HMM, HMMObservationSequence)
  376. double result = HMM_HMM_HMMObservationSequence_getCrossEntropy (me, you, him);
  377. NUMBER_COUPLE_AND_ONE_END (U"(= symmetric cross-entropy between models)")
  378. }
  379. FORM (NEW_HMM_to_HMMObservationSequence, U"HMM: To HMMObservationSequence (generate observations)", U"HMM: To HMMObservationSequence...") {
  380. INTEGER (startState, U"Start state", U"0")
  381. NATURAL (numberOfObservations, U"Number of observations", U"20")
  382. OK
  383. DO
  384. CONVERT_EACH (HMM)
  385. autoHMMObservationSequence result = HMM_to_HMMObservationSequence (me, startState, numberOfObservations);
  386. CONVERT_EACH_END (my name.get())
  387. }
  388. DIRECT (REAL_HMM_HMMStateSequence_getProbability) {
  389. NUMBER_TWO (HMM, HMMStateSequence)
  390. double result = HMM_HMMStateSequence_getProbability (me, you);
  391. NUMBER_TWO_END (U" (= ln(p), p = ", Melder_naturalLogarithm (result), U")")
  392. }
  393. DIRECT (REAL_HMM_HMMObservationSequence_getProbability) {
  394. NUMBER_TWO (HMM, HMMObservationSequence)
  395. double result = HMM_HMMObservationSequence_getProbability (me, you);
  396. NUMBER_TWO_END (U" (= ln(p), p = ", Melder_naturalLogarithm (result), U")")
  397. }
  398. DIRECT (REAL_HMM_HMMObservationSequence_getCrossEntropy) {
  399. NUMBER_TWO (HMM, HMMObservationSequence)
  400. double result = HMM_HMMObservationSequence_getCrossEntropy (me, you);
  401. NUMBER_TWO_END (U" (= cross-entropy)")
  402. }
  403. DIRECT (REAL_HMM_HMMObservationSequence_getPerplexity) {
  404. NUMBER_TWO (HMM, HMMObservationSequence)
  405. double result = HMM_HMMObservationSequence_getPerplexity (me, you);
  406. NUMBER_TWO_END (U" (= perplexity)")
  407. }
  408. DIRECT (NEW1_HMM_HMMObservationSequence_to_HMMStateSequence) {
  409. CONVERT_TWO (HMM, HMMObservationSequence)
  410. autoHMMStateSequence result = HMM_HMMObservationSequence_to_HMMStateSequence (me, you);
  411. CONVERT_TWO_END (my name.get(), U"_", your name.get(), U"_states")
  412. }
  413. FORM (MODIFY_HMM_HMMObservationSequence_learn, U"HMM & HMMObservationSequence: Learn", U"HMM & HMMObservationSequences: Learn...") {
  414. POSITIVE (relativePrecision_log, U"Relative precision in log(p)", U"0.001")
  415. REAL (minimumProbability, U"Minimum probability", U"0.00000000001")
  416. BOOLEAN (showProgress, U"Learning history in Info window", false)
  417. OK
  418. DO
  419. Melder_require (minimumProbability >= 0.0 && minimumProbability < 1.0, U"The minimum probabilty should be in [0, 1).");
  420. MODIFY_FIRST_OF_ONE_AND_LIST(HMM, HMMObservationSequence)
  421. HMM_HMMObservationSequenceBag_learn (me, (HMMObservationSequenceBag) &list, relativePrecision_log, minimumProbability, showProgress);
  422. MODIFY_FIRST_OF_ONE_AND_LIST_END
  423. }
  424. FORM (MODIFY_HMM_setTransitionProbabilities, U"HMM: Set transition probabilities", U"HMM: Set transition probabilities...") {
  425. NATURAL (stateNumber, U"State number", U"1")
  426. SENTENCE (probabilities_string, U"Probabilities", U"0.1 0.9")
  427. OK
  428. DO
  429. MODIFY_EACH (HMM)
  430. HMM_setTransitionProbabilities (me, stateNumber, probabilities_string);
  431. MODIFY_EACH_END
  432. }
  433. FORM (MODIFY_HMM_setEmissionProbabilities, U"HMM: Set emission probabilities", U"HMM: Set emission probabilities...") {
  434. NATURAL (stateNumber, U"State number", U"1")
  435. SENTENCE (probabilities_string, U"Probabilities", U"0.1 0.7 0.2")
  436. OK
  437. DO
  438. MODIFY_EACH (HMM)
  439. HMM_setEmissionProbabilities (me, stateNumber, probabilities_string);
  440. MODIFY_EACH_END
  441. }
  442. FORM (MODIFY_HMM_setStartProbabilities, U"HMM: Set start probabilities", U"HMM: Set start probabilities...") {
  443. SENTENCE (probabilities_string, U"Probabilities", U"0.1 0.9")
  444. OK
  445. DO
  446. MODIFY_EACH (HMM)
  447. HMM_setStartProbabilities (me, probabilities_string);
  448. MODIFY_EACH_END
  449. }
  450. DIRECT (NEW_HMM_extractTransitionProbabilities) {
  451. CONVERT_EACH (HMM)
  452. autoTableOfReal result = HMM_extractTransitionProbabilities (me);
  453. CONVERT_EACH_END (my name.get(), U"_t")
  454. }
  455. DIRECT (NEW_HMM_extractEmissionProbabilities) {
  456. CONVERT_EACH (HMM)
  457. autoTableOfReal result = HMM_extractEmissionProbabilities (me);
  458. CONVERT_EACH_END (my name.get(), U"_e")
  459. }
  460. FORM (NEW_HMMObservationSequence_to_TableOfReal_bigrams, U"HMMObservationSequence: To TableOfReal ", U"HMMObservationSequence: To TableOfReal (bigrams)...") {
  461. BOOLEAN (asProbabilities, U"As probabilities", true)
  462. OK
  463. DO
  464. CONVERT_EACH (HMMObservationSequence)
  465. autoTableOfReal result = HMMObservationSequence_to_TableOfReal_transitions (me, asProbabilities);
  466. CONVERT_EACH_END (my name.get())
  467. }
  468. FORM (NEW1_HMM_HMMObservationSequence_to_TableOfReal_bigrams, U"HMM & HMMObservationSequence: To TableOfReal", U"HMM & HMMObservationSequence: To TableOfReal (bigrams)...") {
  469. BOOLEAN (asProbabilities, U"As probabilities", true)
  470. OK
  471. DO
  472. CONVERT_TWO (HMM, HMMObservationSequence)
  473. autoTableOfReal result = HMM_HMMObservationSequence_to_TableOfReal_transitions (me, you, asProbabilities);
  474. CONVERT_TWO_END (your name.get(), U"_m")
  475. }
  476. FORM (NEW1_HMM_HMMStateSequence_to_TableOfReal_bigrams, U"HMM & HMMStateSequence: To TableOfReal", nullptr) {
  477. BOOLEAN (asProbabilities, U"As probabilities", true)
  478. OK
  479. DO
  480. CONVERT_TWO (HMM, HMMStateSequence)
  481. autoTableOfReal result = HMM_HMMStateSequence_to_TableOfReal_transitions (me, you, asProbabilities);
  482. CONVERT_TWO_END (your name.get(), U"_m")
  483. }
  484. FORM (NEW_HMMStateSequence_to_TableOfReal_bigrams, U"HMMStateSequence: To TableOfReal", nullptr) {
  485. BOOLEAN (asProbabilities, U"As probabilities", true)
  486. OK
  487. DO
  488. CONVERT_EACH (HMMStateSequence)
  489. autoTableOfReal result = Strings_to_TableOfReal_transitions (me, asProbabilities);
  490. CONVERT_EACH_END (my name.get())
  491. }
  492. DIRECT (NEW_HMMObservationSequence_to_Strings) {
  493. CONVERT_EACH (HMMObservationSequence)
  494. autoStrings result = HMMObservationSequence_to_Strings (me);
  495. CONVERT_EACH_END (my name.get())
  496. }
  497. DIRECT (NEW_Strings_to_HMMObservationSequence) {
  498. CONVERT_EACH (Strings)
  499. autoHMMObservationSequence result = Strings_to_HMMObservationSequence (me);
  500. CONVERT_EACH_END (my name.get())
  501. }
  502. DIRECT (NEW_HMMStateSequence_to_Strings) {
  503. CONVERT_EACH (HMMStateSequence)
  504. autoStrings result = HMMStateSequence_to_Strings (me);
  505. CONVERT_EACH_END (my name.get())
  506. }
  507. FORM (NEW_TableOfReal_to_GaussianMixture_rowlabels, U"TableOfReal: To GaussianMixture from row labels", U"TableOfReal: To GaussianMixture (row labels)...") {
  508. OPTIONMENU (matricesType, U"Covariance matrices are", 1)
  509. OPTION (U"Complete")
  510. OPTION (U"Diagonal")
  511. OK
  512. DO
  513. CONVERT_EACH (TableOfReal)
  514. autoGaussianMixture result = TableOfReal_to_GaussianMixture_fromRowLabels (me, matricesType - 1);
  515. CONVERT_EACH_END (my name.get())
  516. }
  517. FORM (NEW_TableOfReal_to_GaussianMixture, U"TableOfReal: To GaussianMixture (no labels)", U"TableOfReal: To GaussianMixture...") {
  518. NATURAL (numberOfComponents, U"Number of components", U"2")
  519. POSITIVE (tolerance, U"Tolerance of minimizer", U"0.001")
  520. INTEGER (maximumNumberOfIterations, U"Maximum number of iterations", U"200")
  521. REAL (lambda, U"Stability coefficient lambda", U"0.001")
  522. OPTIONMENU (matricesType, U"Covariance matrices are", 1)
  523. OPTION (U"Complete")
  524. OPTION (U"Diagonal")
  525. GaussianMixture_OPTION_MENU_CRITERIA
  526. OK
  527. DO
  528. Melder_require (lambda >= 0.0 && lambda < 1.0, U"Lambda should be in the interval [0, 1).");
  529. CONVERT_EACH (TableOfReal)
  530. autoGaussianMixture result = TableOfReal_to_GaussianMixture (me, numberOfComponents, tolerance, maximumNumberOfIterations, lambda, matricesType - 1, criterion - 1);
  531. CONVERT_EACH_END (my name.get())
  532. }
  533. FORM (MODIFY_GaussianMixture_TableOfReal_improveLikelihood, U"GaussianMixture & TableOfReal: Improve likelihood", U"GaussianMixture & TableOfReal: Improve likelihood...") {
  534. POSITIVE (tolerance, U"Tolerance of minimizer", U"0.001")
  535. NATURAL (maximumNumberOfIterations, U"Maximum number of iterations", U"200")
  536. REAL (lambda, U"Stability coefficient lambda", U"0.001")
  537. GaussianMixture_OPTION_MENU_CRITERIA
  538. OK
  539. DO
  540. Melder_require (lambda >= 0.0 && lambda < 1.0, U"Lambda should be in the interval [0, 1).");
  541. MODIFY_FIRST_OF_TWO (GaussianMixture, TableOfReal)
  542. Melder_require (your numberOfColumns == my dimension, U"The number of columns and the dimension of the model do not agree.");
  543. Melder_require (my numberOfComponents < your numberOfRows / 2, U"Not enough data points.");
  544. GaussianMixture_TableOfReal_improveLikelihood (me, you, tolerance, maximumNumberOfIterations, lambda, criterion - 1);
  545. MODIFY_FIRST_OF_TWO_END
  546. }
  547. FORM (NEW1_GaussianMixture_TableOfReal_to_GaussianMixture_CEMM, U"GaussianMixture & TableOfReal: To GaussianMixture (CEMM)", U"GaussianMixture & TableOfReal: To GaussianMixture (CEMM)...") {
  548. INTEGER (minimumNumberOfComponents, U"Minimum number of components", U"1")
  549. POSITIVE (tolerance, U"Tolerance of minimizer", U"0.001")
  550. NATURAL (maximumNumberOfIterations, U"Maximum number of iterations", U"200")
  551. REAL (lambda, U"Stability coefficient lambda (0-1)", U"0.001")
  552. GaussianMixture_OPTION_MENU_CRITERIA
  553. OK
  554. DO
  555. Melder_require (lambda >= 0.0 && lambda < 1.0, U"Lambda should be in the interval [0, 1).");
  556. CONVERT_TWO (GaussianMixture, TableOfReal)
  557. Melder_require (your numberOfColumns == my dimension, U"The number of columns and the dimension of the model do not agree.");
  558. Melder_require (my numberOfComponents < your numberOfRows / 2, U"Not enough data points.");
  559. autoGaussianMixture result = GaussianMixture_TableOfReal_to_GaussianMixture_CEMM (me, you, minimumNumberOfComponents, tolerance, maximumNumberOfIterations, lambda, criterion - 1);
  560. CONVERT_TWO_END (my name.get())
  561. }
  562. DIRECT (NEW1_GaussianMixture_TableOfReal_to_ClassificationTable) {
  563. CONVERT_TWO (GaussianMixture, TableOfReal)
  564. autoClassificationTable result = GaussianMixture_TableOfReal_to_ClassificationTable (me, you);
  565. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  566. }
  567. DIRECT (NEW1_GaussianMixture_TableOfReal_to_Correlation) {
  568. CONVERT_TWO (GaussianMixture, TableOfReal)
  569. autoCorrelation result = GaussianMixture_TableOfReal_to_Correlation (me, you);
  570. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  571. }
  572. FORM (NEW1_GaussianMixture_TableOfReal_to_TableOfReal_BHEPNormalityTests, U"GaussianMixture & TableOfReal: To TableOfReal BHEP normality tests", U"GaussianMixture & TableOfReal: To TableOfReal (BHEP normality tests)...") {
  573. REAL (smoothingParameter, U"Smoothing parameter", U"1.41")
  574. OK
  575. DO
  576. CONVERT_TWO (GaussianMixture, TableOfReal)
  577. autoTableOfReal result = GaussianMixture_TableOfReal_to_TableOfReal_BHEPNormalityTests (me, you, smoothingParameter);
  578. CONVERT_TWO_END (my name.get(), U"_", your name.get())
  579. }
  580. void praat_HMM_init ();
  581. void praat_HMM_init () {
  582. Thing_recognizeClassesByName (classHMM, classHMMState, classHMMObservation, classHMMObservationSequence, classHMMStateSequence, classGaussianMixture, nullptr);
  583. praat_addMenuCommand (U"Objects", U"New", U"Markov models", nullptr, praat_HIDDEN, nullptr);
  584. praat_addMenuCommand (U"Objects", U"New", U"Create HMM...", nullptr, praat_HIDDEN + praat_DEPTH_1, NEW1_HMM_create);
  585. praat_addMenuCommand (U"Objects", U"New", U"Create simple HMM...", nullptr, praat_HIDDEN + praat_DEPTH_1, NEW1_HMM_createSimple);
  586. praat_addMenuCommand (U"Objects", U"New", U"Create continuous HMM...", nullptr, praat_HIDDEN + praat_DEPTH_1, NEW1_HMM_createContinuousModel);
  587. praat_addMenuCommand (U"Objects", U"New", U"--drawings--", nullptr, praat_HIDDEN + praat_DEPTH_1, nullptr);
  588. praat_addMenuCommand (U"Objects", U"New", U"Draw forward probabilities illustration", nullptr, praat_HIDDEN + praat_DEPTH_1, GRAPHICS_HMM_drawForwardProbabilitiesIllustration);
  589. praat_addMenuCommand (U"Objects", U"New", U"Draw backward probabilities illustration", nullptr, praat_HIDDEN + praat_DEPTH_1, GRAPHICS_HMM_drawBackwardProbabilitiesIllustration);
  590. praat_addMenuCommand (U"Objects", U"New", U"Draw forward and backward probabilities illustration", nullptr, praat_HIDDEN + praat_DEPTH_1, GRAPHICS_HMM_drawForwardAndBackwardProbabilitiesIllustration);
  591. praat_addAction1 (classGaussianMixture, 0, U"GaussianMixture help", nullptr, 0, HELP_GaussianMixture_help);
  592. praat_addAction1 (classGaussianMixture, 0, U"Draw concentration ellipses...", nullptr, 0, GRAPHICS_GaussianMixture_drawConcentrationEllipses);
  593. praat_addAction1 (classGaussianMixture, 0, U"Draw marginal pdf...", nullptr, 0, GRAPHICS_GaussianMixture_PCA_drawConcentrationEllipses);
  594. praat_addAction1 (classGaussianMixture, 0, U"Query -", nullptr, 0, nullptr);
  595. praat_addAction1 (classGaussianMixture, 1, U"Get number of components", nullptr, 1, INTEGER_GaussianMixture_getNumberOfComponents);
  596. praat_addAction1 (classGaussianMixture, 1, U"Get dimension of component", nullptr, 1, INTEGER_GaussianMixture_getDimensionOfComponent);
  597. praat_addAction1 (classGaussianMixture, 1, U"Get probability at position...", nullptr, 1, REAL_GaussianMixture_getProbabilityAtPosition);
  598. praat_addAction1 (classGaussianMixture, 0, U"Modify -", nullptr, 0, nullptr);
  599. praat_addAction1 (classGaussianMixture, 1, U"Split component...", nullptr, 1, MODIFY_GaussianMixture_splitComponent);
  600. praat_addAction1 (classGaussianMixture, 0, U"Extract -", nullptr, 0, nullptr);
  601. praat_addAction1 (classGaussianMixture, 0, U"Extract mixing probabilities", nullptr, 1, NEW_GaussianMixture_extractMixingProbabilities);
  602. praat_addAction1 (classGaussianMixture, 0, U"Extract component...", nullptr, 1, NEW_GaussianMixture_extractComponent);
  603. praat_addAction1 (classGaussianMixture, 0, U"Extract centroids", nullptr, 1, NEW_GaussianMixture_extractCentroids);
  604. praat_addAction1 (classGaussianMixture, 0, U"To Covariance (between)", nullptr, 0, NEW_GaussianMixture_to_Covariance_between);
  605. praat_addAction1 (classGaussianMixture, 0, U"To Covariance (within)", nullptr, 0, NEW_GaussianMixture_to_Covariance_within);
  606. praat_addAction1 (classGaussianMixture, 0, U"To Covariance (total)", nullptr, 0, NEW_GaussianMixture_to_Covariance_total);
  607. praat_addAction1 (classGaussianMixture, 0, U"To PCA", nullptr, 0, NEW_GaussianMixture_to_PCA);
  608. praat_addAction1 (classGaussianMixture, 0, U"To TableOfReal (random sampling)...", nullptr, 0, NEW_GaussianMixture_to_TableOfReal_randomSampling);
  609. praat_addAction2 (classGaussianMixture, 1, classTableOfReal, 1, U"Get likelihood value...", nullptr, 0, REAL_GaussianMixture_TableOfReal_getLikelihoodValue);
  610. praat_addAction2 (classGaussianMixture, 1, classTableOfReal, 1, U"Improve likelihood...", nullptr, 0, MODIFY_GaussianMixture_TableOfReal_improveLikelihood);
  611. praat_addAction2 (classGaussianMixture, 1, classTableOfReal, 1, U"To GaussianMixture (CEMM)...", nullptr, 0, NEW1_GaussianMixture_TableOfReal_to_GaussianMixture_CEMM);
  612. praat_addAction2 (classGaussianMixture, 1, classTableOfReal, 1, U"To ClassificationTable", nullptr, 0, NEW1_GaussianMixture_TableOfReal_to_ClassificationTable);
  613. praat_addAction2 (classGaussianMixture, 1, classTableOfReal, 1, U"To Correlation", nullptr, 0, NEW1_GaussianMixture_TableOfReal_to_Correlation);
  614. praat_addAction2 (classGaussianMixture, 1, classTableOfReal, 1, U"To TableOfReal (BHEP normality tests)...", nullptr, 0, NEW1_GaussianMixture_TableOfReal_to_TableOfReal_BHEPNormalityTests);
  615. praat_addAction2 (classGaussianMixture, 1, classPCA, 1, U"Draw concentration ellipses...", nullptr, 0, GRAPHICS_GaussianMixture_PCA_drawConcentrationEllipses);
  616. praat_addAction2 (classGaussianMixture, 1, classPCA, 1, U"Draw marginal pdf...", nullptr, 0, GRAPHICS_GaussianMixture_PCA_drawMarginalPdf);
  617. praat_addAction2 (classGaussianMixture, 1, classPCA, 1, U"To Matrix (density)...", nullptr, 0, NEW1_GaussianMixture_PCA_to_Matrix_density);
  618. praat_addAction1 (classHMM, 0, U"HMM help ", nullptr, 0, HELP_HMM_help);
  619. praat_addAction1 (classHMM, 0, U"Draw...", nullptr, 0, GRAPHICS_HMM_draw);
  620. praat_addAction1 (classHMM, 0, U"Query -", nullptr, 0, nullptr);
  621. praat_addAction1 (classHMM, 1, U"Get transition probability...", nullptr, 1, REAL_HMM_getTransitionProbability);
  622. praat_addAction1 (classHMM, 1, U"Get emission probability...", nullptr, 1, REAL_HMM_getEmissionProbability);
  623. praat_addAction1 (classHMM, 1, U"Get start probability...", nullptr, 1, REAL_HMM_getStartProbability);
  624. praat_addAction1 (classHMM, 1, U"Get p (time, state)...", nullptr, 1, REAL_HMM_getProbabilityAtTimeBeingInState);
  625. praat_addAction1 (classHMM, 1, U"Get p (time, state, symbol)...", nullptr, 1, REAL_HMM_getProbabilityAtTimeBeingInStateEmittingSymbol);
  626. praat_addAction1 (classHMM, 1, U"Get probability staying in state...", nullptr, 1, REAL_HMM_getProbabilityOfStayingInState);
  627. praat_addAction1 (classHMM, 1, U"Get expected duration in state...", nullptr, 1, REAL_HMM_getExpectedDurationInState);
  628. praat_addAction1 (classHMM, 1, U"---- states / symbols -----", nullptr, 1, nullptr);
  629. praat_addAction1 (classHMM, 1, U"Get state label...", nullptr, 1, INFO_HMM_getStateLabel);
  630. praat_addAction1 (classHMM, 1, U"Get symbol label...", nullptr, 1, INFO_HMM_getSymbolLabel);
  631. praat_addAction1 (classHMM, 0, U"--- multiple HMMs ----", nullptr, 1, nullptr);
  632. praat_addAction1 (classHMM, 2, U"Get cross-entropy...", nullptr, 1, REAL_HMM_HMM_getCrossEntropy);
  633. praat_addAction1 (classHMM, 0, U"Modify -", nullptr, 0, nullptr);
  634. praat_addAction1 (classHMM, 1, U"Set transition probabilities...", nullptr, 1, MODIFY_HMM_setTransitionProbabilities);
  635. praat_addAction1 (classHMM, 1, U"Set emission probabilities...", nullptr, 1, MODIFY_HMM_setEmissionProbabilities);
  636. praat_addAction1 (classHMM, 1, U"Set start probabilities...", nullptr, 1, MODIFY_HMM_setStartProbabilities);
  637. praat_addAction1 (classHMM, 0, U"Extract -", nullptr, 0, nullptr);
  638. praat_addAction1 (classHMM, 0, U"Extract transition probabilities", nullptr, 1, NEW_HMM_extractTransitionProbabilities);
  639. praat_addAction1 (classHMM, 0, U"Extract emission probabilities", nullptr, 1, NEW_HMM_extractEmissionProbabilities);
  640. praat_addAction1 (classHMM, 0, U"To HMMObservationSequence...", nullptr, 0, NEW_HMM_to_HMMObservationSequence);
  641. praat_addAction2 (classHMM, 1, classHMMStateSequence, 1, U"Draw trellis...", nullptr, 0, GRAPHICS_HMM_HMMStateSequence_drawTrellis);
  642. praat_addAction2 (classHMM, 1, classHMMStateSequence, 1, U"Get probability", nullptr, 0, REAL_HMM_HMMStateSequence_getProbability);
  643. praat_addAction2 (classHMM, 1, classHMMStateSequence, 1, U"To TableOfReal (bigrams)...", nullptr, 0, NEW1_HMM_HMMStateSequence_to_TableOfReal_bigrams);
  644. praat_addAction2 (classHMM, 1, classHMMObservationSequence, 1, U"Get probability", nullptr, 0, REAL_HMM_HMMObservationSequence_getProbability);
  645. praat_addAction2 (classHMM, 1, classHMMObservationSequence, 1, U"Get cross-entropy", nullptr, 0, REAL_HMM_HMMObservationSequence_getCrossEntropy);
  646. praat_addAction2 (classHMM, 1, classHMMObservationSequence, 1, U"Get perplexity", nullptr, 0, REAL_HMM_HMMObservationSequence_getPerplexity);
  647. praat_addAction2 (classHMM, 1, classHMMObservationSequence, 1, U"To HMMStateSequence", nullptr, 0, NEW1_HMM_HMMObservationSequence_to_HMMStateSequence);
  648. praat_addAction2 (classHMM, 2, classHMMObservationSequence, 1, U"Get cross-entropy", nullptr, 0, REAL_HMM_HMM_HMMObservationSequence_getCrossEntropy);
  649. praat_addAction2 (classHMM, 1, classHMMObservationSequence, 1, U"To TableOfReal (bigrams)...", nullptr, 0, NEW1_HMM_HMMObservationSequence_to_TableOfReal_bigrams);
  650. praat_addAction2 (classHMM, 1, classHMMObservationSequence, 0, U"Learn...", nullptr, 0, MODIFY_HMM_HMMObservationSequence_learn);
  651. praat_addAction1 (classHMMObservationSequence, 0, U"To TableOfReal (bigrams)...", nullptr, 0, NEW_HMMObservationSequence_to_TableOfReal_bigrams);
  652. praat_addAction1 (classHMMObservationSequence, 0, U"To Strings", nullptr, 0, NEW_HMMObservationSequence_to_Strings);
  653. praat_addAction1 (classHMMStateSequence, 0, U"To TableOfReal (bigrams)...", nullptr, 0, NEW_HMMStateSequence_to_TableOfReal_bigrams);
  654. praat_addAction1 (classHMMStateSequence, 0, U"To Strings", nullptr, 0, NEW_HMMStateSequence_to_Strings);
  655. praat_addAction1 (classHMMObservationSequence, 0, U"To HMM...", nullptr, 1, NEW_HMMObservationSequence_to_HMM);
  656. praat_addAction1 (classStrings, 0, U"To HMMObservationSequence", nullptr, praat_HIDDEN, NEW_Strings_to_HMMObservationSequence);
  657. praat_addAction1 (classTableOfReal, 0, U"To GaussianMixture (row labels)...", U"To Covariance", praat_HIDDEN + praat_DEPTH_1, NEW_TableOfReal_to_GaussianMixture_rowlabels);
  658. praat_addAction1 (classTableOfReal, 0, U"To GaussianMixture...", U"To Covariance", praat_HIDDEN + praat_DEPTH_1, NEW_TableOfReal_to_GaussianMixture);
  659. INCLUDE_MANPAGES (manual_HMM)
  660. }
  661. /* End of file praat_HMM_init.cpp 941*/