@genai-fi/nanogpt 1.5.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/dist/{DatasetBuilder-DU1G1OKX.js → DatasetBuilder-DRDW8tcM.js} +85 -86
  2. package/dist/Generator-8IK28IWR.js +316 -0
  3. package/dist/{RealDiv-CSnvtN2E.js → RealDiv-Cl8k3YTx.js} +54 -62
  4. package/dist/{Reshape-BlylqwWy.js → Reshape-CKxKPKqi.js} +9 -12
  5. package/dist/Reshape-H5zZRgr9.js +16 -0
  6. package/dist/RoPECache-dYscFINl.js +722 -0
  7. package/dist/TeachableLLM.js +29 -34
  8. package/dist/api/beamer.js +5 -6
  9. package/dist/api/responses.js +11 -12
  10. package/dist/api/training.js +12 -14
  11. package/dist/axis_util-rF9RnwKE.js +37 -0
  12. package/dist/backend.js +5 -6
  13. package/dist/{backend_util-DAV0I34P.js → backend_util-Cpp0Gwlp.js} +180 -185
  14. package/dist/{binary_op_util-CrYk9LXL.js → binary_op_util-WY9YIl0q.js} +3 -7
  15. package/dist/broadcast_to-CGvLNiQ0.js +20 -0
  16. package/dist/checks/appendCache.js +7 -7
  17. package/dist/checks/attentionMask.js +9 -8
  18. package/dist/checks/check.js +1 -2
  19. package/dist/checks/gelu.js +6 -6
  20. package/dist/checks/index.js +24 -25
  21. package/dist/checks/matMulGelu.js +7 -7
  22. package/dist/checks/normRMS.js +14 -12
  23. package/dist/checks/normRMSGrad.js +9 -8
  24. package/dist/checks/packUnpack.js +7 -7
  25. package/dist/checks/qkv.js +1 -34
  26. package/dist/checks/rope.js +6 -6
  27. package/dist/checks/weights.js +1 -2
  28. package/dist/clip_by_value-D-UX9am5.js +13 -0
  29. package/dist/complex-Cl904TqN.js +13 -0
  30. package/dist/{complex_util-CkazZsaH.js → complex_util-BBlPAm-s.js} +1 -2
  31. package/dist/concat-Oip5acVY.js +14 -0
  32. package/dist/{concat_util-CWzvQQlK.js → concat_util-CY45Hf4F.js} +2 -3
  33. package/dist/data/docx.js +3 -4
  34. package/dist/data/pdf.js +11 -14
  35. package/dist/data/stream.js +1 -2
  36. package/dist/data/textLoader.js +16 -15
  37. package/dist/data-CV_i_H6B.js +11 -0
  38. package/dist/data.js +5 -12
  39. package/dist/dist-CMMLi-qO.js +2675 -0
  40. package/dist/{dist-BGVm64AY.js → dist-DeVH1nGn.js} +1465 -1573
  41. package/dist/{dist-CwK5S7Ls.js → dist-DyL7qSLJ.js} +2664 -2400
  42. package/dist/dropout16-CA31Ud5a.js +20 -0
  43. package/dist/dropout_util-SiFMbFXz.js +22 -0
  44. package/dist/{eventemitter3-D_qV3Lof.js → eventemitter3-wmfmOP_f.js} +2 -3
  45. package/dist/expand_dims-Dh3Fulyn.js +10 -0
  46. package/dist/floor-BwjmUb7X.js +8 -0
  47. package/dist/gather-B5Z1RFt5.js +14 -0
  48. package/dist/gatherSub-CRUfUzBa.js +22 -0
  49. package/dist/gelu-Xx9-ohH9.js +25 -0
  50. package/dist/{gpgpu_math-20tPK8LM.js → gpgpu_math-48m8q3jI.js} +265 -286
  51. package/dist/inference/Beamer.js +34 -27
  52. package/dist/inference/Generator.js +1 -273
  53. package/dist/inference/tokenisePrompt.js +5 -4
  54. package/dist/inference/types.d.ts +6 -0
  55. package/dist/inference/utilities.js +1 -2
  56. package/dist/{jszip.min-DKa1Rjyn.js → jszip.min-Btv48m44.js} +68 -64
  57. package/dist/{kernel_funcs_utils-ql8Y8qPn.js → kernel_funcs_utils-BYRpSfV_.js} +39 -42
  58. package/dist/layers/BaseLayer.js +9 -10
  59. package/dist/layers/GQA.js +45 -44
  60. package/dist/layers/HeadLayer.js +13 -13
  61. package/dist/layers/LoRA.js +17 -20
  62. package/dist/layers/MHA.d.ts +2 -2
  63. package/dist/layers/MHA.js +46 -45
  64. package/dist/layers/MLP.js +22 -21
  65. package/dist/layers/PositionEmbedding.js +14 -13
  66. package/dist/layers/RMSNorm.js +14 -13
  67. package/dist/layers/RoPECache.js +1 -338
  68. package/dist/layers/TiedEmbedding.js +15 -14
  69. package/dist/layers/TransformerBlock.d.ts +3 -9
  70. package/dist/layers/TransformerBlock.js +29 -30
  71. package/dist/layers/WeightStore.js +4 -5
  72. package/dist/layers-CFqEip3s.js +13 -0
  73. package/dist/layers.js +3 -11
  74. package/dist/loader/load.js +27 -24
  75. package/dist/loader/loadHF.js +3 -3
  76. package/dist/loader/loadTransformers.js +5 -6
  77. package/dist/loader/loadZipMeta.js +1 -2
  78. package/dist/loader/newZipLoad.js +1 -2
  79. package/dist/loader/oldZipLoad.js +8 -9
  80. package/dist/loader/save.js +15 -16
  81. package/dist/main.js +3281 -3463
  82. package/dist/{matMul16-CO1QhsRt.js → matMul16-tE26fnhf.js} +29 -27
  83. package/dist/{matMulGelu-CBoqTZM7.js → matMulGelu-ASUWlKqu.js} +33 -33
  84. package/dist/mat_mul-R9_DWmIT.js +16 -0
  85. package/dist/models/Llama.js +48 -49
  86. package/dist/models/NanoGPTV1.js +53 -54
  87. package/dist/models/NanoGPTV2.js +48 -49
  88. package/dist/models/Qwen3.js +48 -49
  89. package/dist/models/config.js +3 -8
  90. package/dist/models/factory.js +7 -8
  91. package/dist/models/model.d.ts +5 -7
  92. package/dist/models/model.js +1 -2
  93. package/dist/models-DyBpJJwM.js +13 -0
  94. package/dist/models.js +6 -14
  95. package/dist/mul16-C7sqgqik.js +41 -0
  96. package/dist/non_max_suppression_impl-B0H318rb.js +72 -0
  97. package/dist/not_equal-Bu3O8rh_.js +67 -0
  98. package/dist/one_hot-TEMPumJj.js +14 -0
  99. package/dist/ones-DpPXWa6A.js +13 -0
  100. package/dist/ops/adamAdjust.js +2 -3
  101. package/dist/ops/adamMoments.js +2 -3
  102. package/dist/ops/add16.js +2 -3
  103. package/dist/ops/appendCache.js +9 -8
  104. package/dist/ops/attentionMask.d.ts +1 -1
  105. package/dist/ops/attentionMask.js +8 -5
  106. package/dist/ops/concat16.js +5 -5
  107. package/dist/ops/cpu/adamAdjust.js +7 -8
  108. package/dist/ops/cpu/adamMoments.js +5 -5
  109. package/dist/ops/cpu/appendCache.js +3 -3
  110. package/dist/ops/cpu/attentionMask.js +12 -8
  111. package/dist/ops/cpu/fusedSoftmax.js +3 -3
  112. package/dist/ops/cpu/gatherSub.js +1 -12
  113. package/dist/ops/cpu/gelu.js +12 -13
  114. package/dist/ops/cpu/matMul16.js +7 -7
  115. package/dist/ops/cpu/matMulGelu.js +21 -18
  116. package/dist/ops/cpu/matMulMul.js +8 -9
  117. package/dist/ops/cpu/mulDropout.js +8 -9
  118. package/dist/ops/cpu/normRMS.js +12 -13
  119. package/dist/ops/cpu/qkv.js +14 -13
  120. package/dist/ops/cpu/rope.js +11 -8
  121. package/dist/ops/cpu/scatterSub.js +1 -12
  122. package/dist/ops/dot16.js +16 -17
  123. package/dist/ops/dropout.js +9 -8
  124. package/dist/ops/dropout16.js +1 -22
  125. package/dist/ops/gatherSub.js +3 -4
  126. package/dist/ops/gelu.js +1 -2
  127. package/dist/ops/globalNorm.js +10 -10
  128. package/dist/ops/grads/add16.js +16 -17
  129. package/dist/ops/grads/attentionMask.js +6 -7
  130. package/dist/ops/grads/dropout16.js +1 -1
  131. package/dist/ops/grads/gelu.js +1 -2
  132. package/dist/ops/grads/matMul16.js +1 -2
  133. package/dist/ops/grads/matMulGelu.js +6 -7
  134. package/dist/ops/grads/mul16.js +1 -1
  135. package/dist/ops/grads/normRMS.js +8 -9
  136. package/dist/ops/grads/pack16.js +1 -2
  137. package/dist/ops/grads/qkv.js +10 -10
  138. package/dist/ops/grads/rope.js +1 -2
  139. package/dist/ops/grads/silu.js +1 -2
  140. package/dist/ops/grads/softmax16.js +6 -7
  141. package/dist/ops/grads/unpack16.js +1 -2
  142. package/dist/ops/grads/utils.js +1 -2
  143. package/dist/ops/matMul16.d.ts +1 -1
  144. package/dist/ops/matMul16.js +1 -2
  145. package/dist/ops/matMulGelu.js +3 -4
  146. package/dist/ops/matMulMul.js +2 -3
  147. package/dist/ops/mul16.js +1 -43
  148. package/dist/ops/mulDrop.js +2 -3
  149. package/dist/ops/normRMS.js +2 -3
  150. package/dist/ops/pack16.js +1 -2
  151. package/dist/ops/qkv.js +2 -3
  152. package/dist/ops/reshape16.js +11 -11
  153. package/dist/ops/rope.js +1 -2
  154. package/dist/ops/scatterSub.js +3 -4
  155. package/dist/ops/silu.js +1 -2
  156. package/dist/ops/slice16.js +5 -5
  157. package/dist/ops/softmax16.js +3 -4
  158. package/dist/ops/sub16.js +3 -4
  159. package/dist/ops/sum16.js +3 -3
  160. package/dist/ops/transpose16.js +16 -15
  161. package/dist/ops/unpack16.js +1 -2
  162. package/dist/ops/webgl/adamAdjust.js +8 -9
  163. package/dist/ops/webgl/adamMoments.js +2 -3
  164. package/dist/ops/webgl/appendCache.js +2 -3
  165. package/dist/ops/webgl/attentionMask.js +2 -3
  166. package/dist/ops/webgl/dropout16.js +2 -3
  167. package/dist/ops/webgl/fusedSoftmax.js +13 -13
  168. package/dist/ops/webgl/gatherSub.js +2 -3
  169. package/dist/ops/webgl/gelu.js +11 -12
  170. package/dist/ops/webgl/log.js +10 -10
  171. package/dist/ops/webgl/matMul16.js +31 -24
  172. package/dist/ops/webgl/matMulGelu.js +1 -2
  173. package/dist/ops/webgl/matMulMul.js +3 -4
  174. package/dist/ops/webgl/mulDropout.js +2 -3
  175. package/dist/ops/webgl/normRMS.js +11 -10
  176. package/dist/ops/webgl/qkv.js +2 -3
  177. package/dist/ops/webgl/rope.js +4 -5
  178. package/dist/ops/webgl/scatterSub.js +2 -3
  179. package/dist/ops/webgpu/adamAdjust.js +13 -14
  180. package/dist/ops/webgpu/adamMoments.js +13 -14
  181. package/dist/ops/webgpu/add16.js +3 -4
  182. package/dist/ops/webgpu/appendCache.js +20 -21
  183. package/dist/ops/webgpu/attentionMask.js +18 -19
  184. package/dist/ops/webgpu/attentionMask32_program.js +7 -8
  185. package/dist/ops/webgpu/clipScale.js +11 -12
  186. package/dist/ops/webgpu/concat16.js +17 -18
  187. package/dist/ops/webgpu/dropout16.js +6 -7
  188. package/dist/ops/webgpu/gatherSub.js +11 -12
  189. package/dist/ops/webgpu/gelu.js +10 -11
  190. package/dist/ops/webgpu/index.js +17 -17
  191. package/dist/ops/webgpu/matMul16.js +74 -63
  192. package/dist/ops/webgpu/matMul16_program.d.ts +2 -1
  193. package/dist/ops/webgpu/matMul16_program.js +29 -21
  194. package/dist/ops/webgpu/mul16.js +3 -4
  195. package/dist/ops/webgpu/norm2.js +9 -10
  196. package/dist/ops/webgpu/normRMS.js +9 -10
  197. package/dist/ops/webgpu/normRMS16_program.js +1 -2
  198. package/dist/ops/webgpu/normRMS32_program.js +1 -2
  199. package/dist/ops/webgpu/normRMSGrad.js +30 -30
  200. package/dist/ops/webgpu/pack16.js +2 -3
  201. package/dist/ops/webgpu/pack16_program.js +3 -4
  202. package/dist/ops/webgpu/qkv.js +10 -11
  203. package/dist/ops/webgpu/rope.js +26 -27
  204. package/dist/ops/webgpu/scatterSub.js +12 -13
  205. package/dist/ops/webgpu/silu.js +10 -11
  206. package/dist/ops/webgpu/slice16.js +17 -18
  207. package/dist/ops/webgpu/softmax16.js +9 -9
  208. package/dist/ops/webgpu/softmax16_program.js +9 -10
  209. package/dist/ops/webgpu/softmax16_subgroup_program.js +11 -12
  210. package/dist/ops/webgpu/softmax16grad.js +8 -9
  211. package/dist/ops/webgpu/sub16.js +3 -4
  212. package/dist/ops/webgpu/sum16.js +16 -15
  213. package/dist/ops/webgpu/transpose16.js +13 -12
  214. package/dist/ops/webgpu/transpose16_program.js +3 -4
  215. package/dist/ops/webgpu/transpose16_shared_program.js +17 -18
  216. package/dist/ops/webgpu/unpack16.js +8 -9
  217. package/dist/ops/webgpu/utils/binary_op.js +20 -21
  218. package/dist/ops/webgpu/utils/deviceInfo.js +1 -2
  219. package/dist/ops/webgpu/utils/reductions.js +21 -20
  220. package/dist/ops-Be5ACU5R.js +13 -0
  221. package/dist/ops-C1UpdEYM.js +509 -0
  222. package/dist/{pack16-BhuXNUS7.js → pack16-BHO4t1-M.js} +14 -17
  223. package/dist/pad-Dy-1IP3A.js +13 -0
  224. package/dist/patches/webgpu_backend.js +18 -19
  225. package/dist/patches/webgpu_base.js +2 -3
  226. package/dist/patches/webgpu_program.js +21 -22
  227. package/dist/{pdf-Bzuk68Vy.js → pdf-CbnQ75VG.js} +380 -701
  228. package/dist/{picomatch-BO4HbNfo.js → picomatch--TW6gyBJ.js} +229 -291
  229. package/dist/qkv-BQfNPucX.js +42 -0
  230. package/dist/rand_util-_vCY93Uw.js +44 -0
  231. package/dist/random_normal-DUIT8kyC.js +11 -0
  232. package/dist/range-CYvQC3fW.js +13 -0
  233. package/dist/relu-C4XULT8A.js +8 -0
  234. package/dist/reshape-DJb1jgMt.js +8 -0
  235. package/dist/resize_nearest_neighbor-DAqcTYUe.js +188 -0
  236. package/dist/{chunk-CWhphoD1.js → rolldown-runtime-CwxnZyOB.js} +4 -5
  237. package/dist/{rope-BPu_uooz.js → rope-JjBVufF_.js} +6 -8
  238. package/dist/scatterSub-BOnqk-uY.js +27 -0
  239. package/dist/scatter_nd_util-BepMCpLY.js +34 -0
  240. package/dist/seedrandom-SHEGFK6H.js +282 -0
  241. package/dist/selu_util-DeOTf-sc.js +27 -0
  242. package/dist/shared-BIDMUBCs.js +1864 -0
  243. package/dist/{shared-CfTzpULd.js → shared-CX_iPI5K.js} +2 -3
  244. package/dist/silu-DsAE2cJ5.js +23 -0
  245. package/dist/slice-Dlb1FlzG.js +13 -0
  246. package/dist/{slice_util-Dve4TkDn.js → slice_util-BVgPRoij.js} +3 -4
  247. package/dist/softmax-Dpav_dWw.js +10 -0
  248. package/dist/split-DYnT8chz.js +11 -0
  249. package/dist/squeeze-B3XYGAlg.js +9 -0
  250. package/dist/stack-Dbbt9mIk.js +10 -0
  251. package/dist/step-DA-5DNu9.js +348 -0
  252. package/dist/{stream-BpAwcvHz.js → stream-BBe2apn4.js} +68 -88
  253. package/dist/sum-C8qNbFNp.js +13 -0
  254. package/dist/tensor-ALxWZfmz.js +7 -0
  255. package/dist/tensor1d-BHgkkhTE.js +9 -0
  256. package/dist/tensor2d-ARItvqVn.js +10 -0
  257. package/dist/tensor4d-D1zRBipJ.js +10 -0
  258. package/dist/tfjs_backend-CsXOum0h.js +685 -0
  259. package/dist/tile-DfyQ0KX-.js +10 -0
  260. package/dist/tokenise-DbS2Ea-T.js +14 -0
  261. package/dist/tokenise.js +6 -15
  262. package/dist/tokeniser/BaseTokeniser.js +5 -9
  263. package/dist/tokeniser/CharTokeniser.js +1 -2
  264. package/dist/tokeniser/bpe.js +19 -20
  265. package/dist/topk-BrU2pkrR.js +19 -0
  266. package/dist/training/AdamW.js +35 -31
  267. package/dist/training/BasicTrainer.js +56 -56
  268. package/dist/training/DatasetBuilder.js +1 -2
  269. package/dist/training/Evaluator.js +4 -4
  270. package/dist/training/LRScheduler.js +1 -2
  271. package/dist/training/PreTrainer.js +7 -8
  272. package/dist/training/SFTTrainer.js +7 -8
  273. package/dist/training/configure.js +16 -15
  274. package/dist/training/factory.js +1 -2
  275. package/dist/training/loss.js +1 -2
  276. package/dist/training/orthoGrad.js +2 -3
  277. package/dist/training/prepareData.js +18 -17
  278. package/dist/training/sparseCrossEntropy.js +38 -32
  279. package/dist/training/tasks/TokenStore.js +21 -22
  280. package/dist/training/tasks/tokenStream.js +1 -2
  281. package/dist/training/validateOptions.js +1 -2
  282. package/dist/training/validation.js +1 -2
  283. package/dist/transpose-BC-M_OoT.js +34 -0
  284. package/dist/unsorted_segment_sum-BelC7R-q.js +408 -0
  285. package/dist/utilities/arrayClose.js +5 -4
  286. package/dist/utilities/arrayShape.js +1 -2
  287. package/dist/utilities/datasetID.js +1 -2
  288. package/dist/utilities/dummy.js +15 -15
  289. package/dist/utilities/float16.js +10 -10
  290. package/dist/utilities/maxHeap.js +1 -2
  291. package/dist/utilities/multinomialCPU.d.ts +1 -2
  292. package/dist/utilities/multinomialCPU.js +6 -8
  293. package/dist/utilities/packed.js +2 -3
  294. package/dist/utilities/parameters.js +3 -4
  295. package/dist/utilities/performance.js +2 -3
  296. package/dist/utilities/profile.js +3 -4
  297. package/dist/utilities/random.js +1 -2
  298. package/dist/utilities/safetensors.js +14 -14
  299. package/dist/utilities/sentences.js +16 -13
  300. package/dist/utilities/tokenParse.js +1 -2
  301. package/dist/utilities/tokens.js +5 -6
  302. package/dist/utilities/topP.d.ts +1 -0
  303. package/dist/utilities/topP.js +20 -13
  304. package/dist/utilities/waitForModel.js +1 -2
  305. package/dist/utilities/weights.js +4 -4
  306. package/dist/utilities/yielder.js +1 -2
  307. package/dist/{v4-BK7K-jy_.js → v4-YCkfo8OR.js} +4 -7
  308. package/dist/{webgpu-IAn9VotJ.js → webgpu-BHX-uBym.js} +156 -163
  309. package/dist/{webgpu_program-B0PokuRJ.js → webgpu_program-DvkFqRlR.js} +28 -29
  310. package/dist/{webgpu_util-DfODg6XI.js → webgpu_util-5QTyovaf.js} +2 -3
  311. package/dist/zeros-hxKGkRfl.js +12 -0
  312. package/package.json +3 -3
  313. package/dist/Reshape-CwxdaU8n.js +0 -17
  314. package/dist/dist-Da20xy8E.js +0 -6375
  315. package/dist/gelu-B6637MKa.js +0 -27
  316. package/dist/selu_util-B_AFEfoz.js +0 -24
  317. package/dist/shared-24EoeHJl.js +0 -1314
  318. package/dist/silu-B6bvCgJ7.js +0 -25
  319. package/dist/tfjs_backend-h5weiy1O.js +0 -614
@@ -0,0 +1,282 @@
1
+ import { r as e, t } from "./rolldown-runtime-CwxnZyOB.js";
2
+ // node_modules/seedrandom/lib/alea.js
3
+ var n = /* @__PURE__ */ t(((e, t, n) => {
4
+ (function(e, t, n) {
5
+ function r(e) {
6
+ var t = this, n = o();
7
+ t.next = function() {
8
+ var e = 2091639 * t.s0 + t.c * 23283064365386963e-26;
9
+ return t.s0 = t.s1, t.s1 = t.s2, t.s2 = e - (t.c = e | 0);
10
+ }, t.c = 1, t.s0 = n(" "), t.s1 = n(" "), t.s2 = n(" "), t.s0 -= n(e), t.s0 < 0 && (t.s0 += 1), t.s1 -= n(e), t.s1 < 0 && (t.s1 += 1), t.s2 -= n(e), t.s2 < 0 && (t.s2 += 1), n = null;
11
+ }
12
+ function i(e, t) {
13
+ return t.c = e.c, t.s0 = e.s0, t.s1 = e.s1, t.s2 = e.s2, t;
14
+ }
15
+ function a(e, t) {
16
+ var n = new r(e), a = t && t.state, o = n.next;
17
+ return o.int32 = function() {
18
+ return n.next() * 4294967296 | 0;
19
+ }, o.double = function() {
20
+ return o() + (o() * 2097152 | 0) * 11102230246251565e-32;
21
+ }, o.quick = o, a && (typeof a == "object" && i(a, n), o.state = function() {
22
+ return i(n, {});
23
+ }), o;
24
+ }
25
+ function o() {
26
+ var e = 4022871197;
27
+ return function(t) {
28
+ t = String(t);
29
+ for (var n = 0; n < t.length; n++) {
30
+ e += t.charCodeAt(n);
31
+ var r = .02519603282416938 * e;
32
+ e = r >>> 0, r -= e, r *= e, e = r >>> 0, r -= e, e += r * 4294967296;
33
+ }
34
+ return (e >>> 0) * 23283064365386963e-26;
35
+ };
36
+ }
37
+ t && t.exports ? t.exports = a : n && n.amd ? n(function() {
38
+ return a;
39
+ }) : this.alea = a;
40
+ })(n, typeof t == "object" && t, typeof define == "function" && define);
41
+ })), r = /* @__PURE__ */ t(((e, t, n) => {
42
+ (function(e, t, n) {
43
+ function r(e) {
44
+ var t = this, n = "";
45
+ t.x = 0, t.y = 0, t.z = 0, t.w = 0, t.next = function() {
46
+ var e = t.x ^ t.x << 11;
47
+ return t.x = t.y, t.y = t.z, t.z = t.w, t.w ^= t.w >>> 19 ^ e ^ e >>> 8;
48
+ }, e === (e | 0) ? t.x = e : n += e;
49
+ for (var r = 0; r < n.length + 64; r++) t.x ^= n.charCodeAt(r) | 0, t.next();
50
+ }
51
+ function i(e, t) {
52
+ return t.x = e.x, t.y = e.y, t.z = e.z, t.w = e.w, t;
53
+ }
54
+ function a(e, t) {
55
+ var n = new r(e), a = t && t.state, o = function() {
56
+ return (n.next() >>> 0) / 4294967296;
57
+ };
58
+ return o.double = function() {
59
+ do
60
+ var e = ((n.next() >>> 11) + (n.next() >>> 0) / 4294967296) / (1 << 21);
61
+ while (e === 0);
62
+ return e;
63
+ }, o.int32 = n.next, o.quick = o, a && (typeof a == "object" && i(a, n), o.state = function() {
64
+ return i(n, {});
65
+ }), o;
66
+ }
67
+ t && t.exports ? t.exports = a : n && n.amd ? n(function() {
68
+ return a;
69
+ }) : this.xor128 = a;
70
+ })(n, typeof t == "object" && t, typeof define == "function" && define);
71
+ })), i = /* @__PURE__ */ t(((e, t, n) => {
72
+ (function(e, t, n) {
73
+ function r(e) {
74
+ var t = this, n = "";
75
+ t.next = function() {
76
+ var e = t.x ^ t.x >>> 2;
77
+ return t.x = t.y, t.y = t.z, t.z = t.w, t.w = t.v, (t.d = t.d + 362437 | 0) + (t.v = t.v ^ t.v << 4 ^ (e ^ e << 1)) | 0;
78
+ }, t.x = 0, t.y = 0, t.z = 0, t.w = 0, t.v = 0, e === (e | 0) ? t.x = e : n += e;
79
+ for (var r = 0; r < n.length + 64; r++) t.x ^= n.charCodeAt(r) | 0, r == n.length && (t.d = t.x << 10 ^ t.x >>> 4), t.next();
80
+ }
81
+ function i(e, t) {
82
+ return t.x = e.x, t.y = e.y, t.z = e.z, t.w = e.w, t.v = e.v, t.d = e.d, t;
83
+ }
84
+ function a(e, t) {
85
+ var n = new r(e), a = t && t.state, o = function() {
86
+ return (n.next() >>> 0) / 4294967296;
87
+ };
88
+ return o.double = function() {
89
+ do
90
+ var e = ((n.next() >>> 11) + (n.next() >>> 0) / 4294967296) / (1 << 21);
91
+ while (e === 0);
92
+ return e;
93
+ }, o.int32 = n.next, o.quick = o, a && (typeof a == "object" && i(a, n), o.state = function() {
94
+ return i(n, {});
95
+ }), o;
96
+ }
97
+ t && t.exports ? t.exports = a : n && n.amd ? n(function() {
98
+ return a;
99
+ }) : this.xorwow = a;
100
+ })(n, typeof t == "object" && t, typeof define == "function" && define);
101
+ })), a = /* @__PURE__ */ t(((e, t, n) => {
102
+ (function(e, t, n) {
103
+ function r(e) {
104
+ var t = this;
105
+ t.next = function() {
106
+ var e = t.x, n = t.i, r = e[n], i;
107
+ return r ^= r >>> 7, i = r ^ r << 24, r = e[n + 1 & 7], i ^= r ^ r >>> 10, r = e[n + 3 & 7], i ^= r ^ r >>> 3, r = e[n + 4 & 7], i ^= r ^ r << 7, r = e[n + 7 & 7], r ^= r << 13, i ^= r ^ r << 9, e[n] = i, t.i = n + 1 & 7, i;
108
+ };
109
+ function n(e, t) {
110
+ var n, r = [];
111
+ if (t === (t | 0)) r[0] = t;
112
+ else for (t = "" + t, n = 0; n < t.length; ++n) r[n & 7] = r[n & 7] << 15 ^ t.charCodeAt(n) + r[n + 1 & 7] << 13;
113
+ for (; r.length < 8;) r.push(0);
114
+ for (n = 0; n < 8 && r[n] === 0; ++n);
115
+ for (n == 8 ? r[7] = -1 : r[n], e.x = r, e.i = 0, n = 256; n > 0; --n) e.next();
116
+ }
117
+ n(t, e);
118
+ }
119
+ function i(e, t) {
120
+ return t.x = e.x.slice(), t.i = e.i, t;
121
+ }
122
+ function a(e, t) {
123
+ e ??= +/* @__PURE__ */ new Date();
124
+ var n = new r(e), a = t && t.state, o = function() {
125
+ return (n.next() >>> 0) / 4294967296;
126
+ };
127
+ return o.double = function() {
128
+ do
129
+ var e = ((n.next() >>> 11) + (n.next() >>> 0) / 4294967296) / (1 << 21);
130
+ while (e === 0);
131
+ return e;
132
+ }, o.int32 = n.next, o.quick = o, a && (a.x && i(a, n), o.state = function() {
133
+ return i(n, {});
134
+ }), o;
135
+ }
136
+ t && t.exports ? t.exports = a : n && n.amd ? n(function() {
137
+ return a;
138
+ }) : this.xorshift7 = a;
139
+ })(n, typeof t == "object" && t, typeof define == "function" && define);
140
+ })), o = /* @__PURE__ */ t(((e, t, n) => {
141
+ (function(e, t, n) {
142
+ function r(e) {
143
+ var t = this;
144
+ t.next = function() {
145
+ var e = t.w, n = t.X, r = t.i, i, a;
146
+ return t.w = e = e + 1640531527 | 0, a = n[r + 34 & 127], i = n[r = r + 1 & 127], a ^= a << 13, i ^= i << 17, a ^= a >>> 15, i ^= i >>> 12, a = n[r] = a ^ i, t.i = r, a + (e ^ e >>> 16) | 0;
147
+ };
148
+ function n(e, t) {
149
+ var n, r, i, a, o, s = [], c = 128;
150
+ for (t === (t | 0) ? (r = t, t = null) : (t += "\0", r = 0, c = Math.max(c, t.length)), i = 0, a = -32; a < c; ++a) t && (r ^= t.charCodeAt((a + 32) % t.length)), a === 0 && (o = r), r ^= r << 10, r ^= r >>> 15, r ^= r << 4, r ^= r >>> 13, a >= 0 && (o = o + 1640531527 | 0, n = s[a & 127] ^= r + o, i = n == 0 ? i + 1 : 0);
151
+ for (i >= 128 && (s[(t && t.length || 0) & 127] = -1), i = 127, a = 512; a > 0; --a) r = s[i + 34 & 127], n = s[i = i + 1 & 127], r ^= r << 13, n ^= n << 17, r ^= r >>> 15, n ^= n >>> 12, s[i] = r ^ n;
152
+ e.w = o, e.X = s, e.i = i;
153
+ }
154
+ n(t, e);
155
+ }
156
+ function i(e, t) {
157
+ return t.i = e.i, t.w = e.w, t.X = e.X.slice(), t;
158
+ }
159
+ function a(e, t) {
160
+ e ??= +/* @__PURE__ */ new Date();
161
+ var n = new r(e), a = t && t.state, o = function() {
162
+ return (n.next() >>> 0) / 4294967296;
163
+ };
164
+ return o.double = function() {
165
+ do
166
+ var e = ((n.next() >>> 11) + (n.next() >>> 0) / 4294967296) / (1 << 21);
167
+ while (e === 0);
168
+ return e;
169
+ }, o.int32 = n.next, o.quick = o, a && (a.X && i(a, n), o.state = function() {
170
+ return i(n, {});
171
+ }), o;
172
+ }
173
+ t && t.exports ? t.exports = a : n && n.amd ? n(function() {
174
+ return a;
175
+ }) : this.xor4096 = a;
176
+ })(n, typeof t == "object" && t, typeof define == "function" && define);
177
+ })), s = /* @__PURE__ */ t(((e, t, n) => {
178
+ (function(e, t, n) {
179
+ function r(e) {
180
+ var t = this, n = "";
181
+ t.next = function() {
182
+ var e = t.b, n = t.c, r = t.d, i = t.a;
183
+ return e = e << 25 ^ e >>> 7 ^ n, n = n - r | 0, r = r << 24 ^ r >>> 8 ^ i, i = i - e | 0, t.b = e = e << 20 ^ e >>> 12 ^ n, t.c = n = n - r | 0, t.d = r << 16 ^ n >>> 16 ^ i, t.a = i - e | 0;
184
+ }, t.a = 0, t.b = 0, t.c = -1640531527, t.d = 1367130551, e === Math.floor(e) ? (t.a = e / 4294967296 | 0, t.b = e | 0) : n += e;
185
+ for (var r = 0; r < n.length + 20; r++) t.b ^= n.charCodeAt(r) | 0, t.next();
186
+ }
187
+ function i(e, t) {
188
+ return t.a = e.a, t.b = e.b, t.c = e.c, t.d = e.d, t;
189
+ }
190
+ function a(e, t) {
191
+ var n = new r(e), a = t && t.state, o = function() {
192
+ return (n.next() >>> 0) / 4294967296;
193
+ };
194
+ return o.double = function() {
195
+ do
196
+ var e = ((n.next() >>> 11) + (n.next() >>> 0) / 4294967296) / (1 << 21);
197
+ while (e === 0);
198
+ return e;
199
+ }, o.int32 = n.next, o.quick = o, a && (typeof a == "object" && i(a, n), o.state = function() {
200
+ return i(n, {});
201
+ }), o;
202
+ }
203
+ t && t.exports ? t.exports = a : n && n.amd ? n(function() {
204
+ return a;
205
+ }) : this.tychei = a;
206
+ })(n, typeof t == "object" && t, typeof define == "function" && define);
207
+ })), c = /* @__PURE__ */ t(((t, n, r) => {
208
+ (function(t, r, i) {
209
+ var a = 256, o = 6, s = 52, c = "random", l = i.pow(a, o), u = i.pow(2, s), d = u * 2, f = a - 1, p;
210
+ function m(e, t, n) {
211
+ var s = [];
212
+ t = t == 1 ? { entropy: !0 } : t || {};
213
+ var f = v(_(t.entropy ? [e, b(r)] : e ?? y(), 3), s), p = new h(s), m = function() {
214
+ for (var e = p.g(o), t = l, n = 0; e < u;) e = (e + n) * a, t *= a, n = p.g(1);
215
+ for (; e >= d;) e /= 2, t /= 2, n >>>= 1;
216
+ return (e + n) / t;
217
+ };
218
+ return m.int32 = function() {
219
+ return p.g(4) | 0;
220
+ }, m.quick = function() {
221
+ return p.g(4) / 4294967296;
222
+ }, m.double = m, v(b(p.S), r), (t.pass || n || function(e, t, n, r) {
223
+ return r && (r.S && g(r, p), e.state = function() {
224
+ return g(p, {});
225
+ }), n ? (i[c] = e, t) : e;
226
+ })(m, f, "global" in t ? t.global : this == i, t.state);
227
+ }
228
+ function h(e) {
229
+ var t, n = e.length, r = this, i = 0, o = r.i = r.j = 0, s = r.S = [];
230
+ for (n || (e = [n++]); i < a;) s[i] = i++;
231
+ for (i = 0; i < a; i++) s[i] = s[o = f & o + e[i % n] + (t = s[i])], s[o] = t;
232
+ (r.g = function(e) {
233
+ for (var t, n = 0, i = r.i, o = r.j, s = r.S; e--;) t = s[i = f & i + 1], n = n * a + s[f & (s[i] = s[o = f & o + t]) + (s[o] = t)];
234
+ return r.i = i, r.j = o, n;
235
+ })(a);
236
+ }
237
+ function g(e, t) {
238
+ return t.i = e.i, t.j = e.j, t.S = e.S.slice(), t;
239
+ }
240
+ function _(e, t) {
241
+ var n = [], r = typeof e, i;
242
+ if (t && r == "object") for (i in e) try {
243
+ n.push(_(e[i], t - 1));
244
+ } catch {}
245
+ return n.length ? n : r == "string" ? e : e + "\0";
246
+ }
247
+ function v(e, t) {
248
+ for (var n = e + "", r, i = 0; i < n.length;) t[f & i] = f & (r ^= t[f & i] * 19) + n.charCodeAt(i++);
249
+ return b(t);
250
+ }
251
+ function y() {
252
+ try {
253
+ var e;
254
+ return p && (e = p.randomBytes) ? e = e(a) : (e = new Uint8Array(a), (t.crypto || t.msCrypto).getRandomValues(e)), b(e);
255
+ } catch {
256
+ var n = t.navigator, i = n && n.plugins;
257
+ return [
258
+ +/* @__PURE__ */ new Date(),
259
+ t,
260
+ i,
261
+ t.screen,
262
+ b(r)
263
+ ];
264
+ }
265
+ }
266
+ function b(e) {
267
+ return String.fromCharCode.apply(0, e);
268
+ }
269
+ if (v(i.random(), r), typeof n == "object" && n.exports) {
270
+ n.exports = m;
271
+ try {
272
+ p = e("crypto");
273
+ } catch {}
274
+ } else typeof define == "function" && define.amd ? define(function() {
275
+ return m;
276
+ }) : i["seed" + c] = m;
277
+ })(typeof self < "u" ? self : r, [], Math);
278
+ })), l = /* @__PURE__ */ t(((e, t) => {
279
+ var l = n(), u = r(), d = i(), f = a(), p = o(), m = s(), h = c();
280
+ h.alea = l, h.xor128 = u, h.xorwow = d, h.xorshift7 = f, h.xor4096 = p, h.tychei = m, t.exports = h;
281
+ }));
282
+ export { l as t };
@@ -0,0 +1,27 @@
1
+ import { O as e, T as t } from "./dist-CMMLi-qO.js";
2
+ import { a as n, i as r, n as i, o as a, r as o, t as s } from "./step-DA-5DNu9.js";
3
+ import { t as c } from "./reshape-DJb1jgMt.js";
4
+ import { t as l } from "./sum-C8qNbFNp.js";
5
+ import { t as u } from "./relu-C4XULT8A.js";
6
+ // node_modules/@tensorflow/tfjs-core/dist/ops/fused_util.js
7
+ function d(t, n, r) {
8
+ if (r == null || r === "linear") return t;
9
+ if (r === "relu") return e(t, s(n));
10
+ throw Error(`Cannot compute gradient for fused activation ${r}.`);
11
+ }
12
+ function f(e, n) {
13
+ let r = n, i = t(e.shape, n.shape);
14
+ return i.length > 0 && (r = l(r, i)), c(r, e.shape);
15
+ }
16
+ function p(e, t, s, c) {
17
+ if (t === "linear") return e;
18
+ if (t === "relu") return u(e);
19
+ if (t === "elu") return n(e);
20
+ if (t === "relu6") return i(e);
21
+ if (t === "prelu") return o(e, s);
22
+ if (t === "leakyrelu") return r(e, c);
23
+ if (t === "sigmoid") return a(e);
24
+ throw Error(`Unknown fused activation ${t}.`);
25
+ }
26
+ var m = (e, t) => !(e > 0) || t === "linear", h = 1.7580993408473768, g = 1.0507009873554805;
27
+ export { d as a, f as i, h as n, m as o, p as r, g as t };