{"_id":"@akhyar11/ml-v1","_rev":"9-a639a2d14df00c2888b9ac87ecf82f19","name":"@akhyar11/ml-v1","dist-tags":{"latest":"2.3.0","alpha":"2.3.0-alpha.3"},"versions":{"2.2.5":{"name":"@akhyar11/ml-v1","version":"2.2.5","keywords":["machine-learning","ml","neural-network","transformer","matrix","deep-learning","typescript","rust","napi","bpe-tokenizer","sequential","lstm","gru","rnn","attention"],"author":{"name":"Akhyar"},"license":"ISC","_id":"@akhyar11/ml-v1@2.2.5","maintainers":[{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"}],"homepage":"https://github.com/Akhyar11/ML-V1#readme","bugs":{"url":"https://github.com/Akhyar11/ML-V1/issues"},"dist":{"shasum":"362c50bfb43821246121efb0121ad06cd166b385","tarball":"https://registry.npmjs.org/@akhyar11/ml-v1/-/ml-v1-2.2.5.tgz","fileCount":309,"integrity":"sha512-z8zd0mGKpmlU0I4wHtEAAgAdstKTIJCGdVSJ8B0bey37zLkTQn5zGdwsIFZUGvwIN5bWt2skQTilEWE1oHCLSQ==","signatures":[{"sig":"MEYCIQCo/6gzCZvYzK9aKqW3aW1Rkkooni2mB2jtNsH7cqEbaQIhAIi4GL5eq67ryxwwaRRpjr+sEMAOoRqx3y2gtrExHGwG","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1017029},"main":"dist/index.js","napi":{"name":"ml-native"},"types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.js"},"./native":{"types":"./index.d.ts","default":"./index.js","require":"./index.js"}},"gitHead":"223efe178c9cc2054dc3b39152b31dd4bec6a44b","scripts":{"test":"node -r ts-node/register test/index.ts","start":"clear && tsc && time node build/main.js","build:rust":"napi build --platform --release --cargo-cwd src-rust","postinstall":"node -e \"try{require('child_process').execSync('napi build --platform --release --cargo-cwd src-rust',{stdio:'inherit'})}catch(e){console.warn('[ml-v1] Rust build skipped — native acceleration unavailable. Install Rust (https://rustup.rs) and run: npm run build:rust')}\"","build:publish":"rm -rf dist && tsc -p tsconfig.publish.json","prepublishOnly":"npm run build:publish","build:rust:debug":"napi build --platform --cargo-cwd src-rust"},"_npmUser":{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"},"repository":{"url":"git+https://github.com/Akhyar11/ML-V1.git","type":"git"},"_npmVersion":"11.12.1","description":"TypeScript + Rust Native machine learning library. Matrix ops, layers (Dense, Embedding, RNN, LSTM, GRU, MultiHeadAttention, etc), models (Sequential, Transformers), dan BPE tokenizer.","directories":{},"_nodeVersion":"25.8.2","dependencies":{"ts-node":"^10.9.2","@napi-rs/cli":"^2.18.0","@napi-rs/wasm-runtime":"^0.2.4"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^20.11.20"},"_npmOperationalInternal":{"tmp":"tmp/ml-v1_2.2.5_1777091359335_0.672567164180722","host":"s3://npm-registry-packages-npm-production"}},"2.2.6":{"name":"@akhyar11/ml-v1","version":"2.2.6","keywords":["machine-learning","ml","neural-network","transformer","matrix","deep-learning","typescript","rust","napi","bpe-tokenizer","sequential","lstm","gru","rnn","attention"],"author":{"name":"Akhyar"},"license":"ISC","_id":"@akhyar11/ml-v1@2.2.6","maintainers":[{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"}],"homepage":"https://github.com/Akhyar11/ML-V1#readme","bugs":{"url":"https://github.com/Akhyar11/ML-V1/issues"},"dist":{"shasum":"f45238024c6027fcabc6da214871721d5e305e16","tarball":"https://registry.npmjs.org/@akhyar11/ml-v1/-/ml-v1-2.2.6.tgz","fileCount":309,"integrity":"sha512-V2zWd8uJLvwrBsqHnhQoaIU/VSMQxZBmOjArwdlGMen+M4KzHAX9iVMB/UmSgGsEzD0Shmug1ACvF8C4YeDZxQ==","signatures":[{"sig":"MEYCIQCMvqwMzUEu3CeeXRMuP6rbTjEQ8H6dw4fdMnWcpyMXCQIhAPHnLxAryaH3PlhBob1rtxxlwPMyJ7zvHNjv3U3+exDi","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1020878},"main":"dist/index.js","napi":{"name":"ml-native"},"types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.js"},"./native":{"types":"./index.d.ts","default":"./index.js","require":"./index.js"}},"gitHead":"3af411140e9e3028ff406dd5a9fa51bb5af4b4ce","scripts":{"test":"node -r ts-node/register test/index.ts","start":"clear && tsc && time node build/main.js","build:rust":"napi build --platform --release --cargo-cwd src-rust","postinstall":"node -e \"try{require('child_process').execSync('napi build --platform --release --cargo-cwd src-rust',{stdio:'inherit'})}catch(e){console.warn('[ml-v1] Rust build skipped — native acceleration unavailable. Install Rust (https://rustup.rs) and run: npm run build:rust')}\"","build:publish":"rm -rf dist && tsc -p tsconfig.publish.json","prepublishOnly":"npm run build:publish","build:rust:debug":"napi build --platform --cargo-cwd src-rust"},"_npmUser":{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"},"repository":{"url":"git+https://github.com/Akhyar11/ML-V1.git","type":"git"},"_npmVersion":"10.8.2","description":"TypeScript + Rust Native machine learning library. Matrix ops, layers (Dense, Embedding, RNN, LSTM, GRU, MultiHeadAttention, etc), models (Sequential, Transformers), dan BPE tokenizer.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"ts-node":"^10.9.2","@napi-rs/cli":"^2.18.0","@napi-rs/wasm-runtime":"^0.2.4"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^20.11.20"},"_npmOperationalInternal":{"tmp":"tmp/ml-v1_2.2.6_1777099033438_0.7010125962410649","host":"s3://npm-registry-packages-npm-production"}},"2.2.7":{"name":"@akhyar11/ml-v1","version":"2.2.7","keywords":["machine-learning","ml","neural-network","transformer","matrix","deep-learning","typescript","rust","napi","bpe-tokenizer","sequential","lstm","gru","rnn","attention"],"author":{"name":"Akhyar"},"license":"ISC","_id":"@akhyar11/ml-v1@2.2.7","maintainers":[{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"}],"homepage":"https://github.com/Akhyar11/ML-V1#readme","bugs":{"url":"https://github.com/Akhyar11/ML-V1/issues"},"dist":{"shasum":"0120c5415fa70a2baad08e1e68359f56ea5247fb","tarball":"https://registry.npmjs.org/@akhyar11/ml-v1/-/ml-v1-2.2.7.tgz","fileCount":313,"integrity":"sha512-8WutPzUaKoUnpf/vFScsbdHpOtzo3r1Ms/1/vwh+r9S+7hFZ0U63XgeUokFjUV4NHzLcwSPLrKl1jePAoFf08A==","signatures":[{"sig":"MEUCIDC7qMwQBwepP8RZwWh4nmpOIIZVxda4cUg0DkumP8YXAiEAxiZhc6++21BJ/1i95pgYMn3s3pv5TNTZ/2k0yPPEVDI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1050479},"main":"dist/index.js","napi":{"name":"ml-native"},"types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.js"},"./native":{"types":"./index.d.ts","default":"./index.js","require":"./index.js"}},"gitHead":"bd8a8f5bfa8f05d84399f25e7476c3eea5fb327c","scripts":{"test":"node -r ts-node/register test/index.ts","start":"clear && tsc && time node build/main.js","build:rust":"napi build --platform --release --cargo-cwd src-rust","postinstall":"node -e \"try{require('child_process').execSync('napi build --platform --release --cargo-cwd src-rust',{stdio:'inherit'})}catch(e){console.warn('[ml-v1] Rust build skipped — native acceleration unavailable. Install Rust (https://rustup.rs) and run: npm run build:rust')}\"","build:publish":"rm -rf dist && tsc -p tsconfig.publish.json","prepublishOnly":"npm run build:publish","build:rust:debug":"napi build --platform --cargo-cwd src-rust"},"_npmUser":{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"},"repository":{"url":"git+https://github.com/Akhyar11/ML-V1.git","type":"git"},"_npmVersion":"10.8.2","description":"TypeScript + Rust Native machine learning library. Matrix ops, layers (Dense, Embedding, RNN, LSTM, GRU, MultiHeadAttention, etc), models (Sequential, Transformers), dan BPE tokenizer.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"ts-node":"^10.9.2","@napi-rs/cli":"^2.18.0","@napi-rs/wasm-runtime":"^0.2.4"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^20.11.20"},"_npmOperationalInternal":{"tmp":"tmp/ml-v1_2.2.7_1777128411539_0.8907493702127545","host":"s3://npm-registry-packages-npm-production"}},"2.2.8":{"name":"@akhyar11/ml-v1","version":"2.2.8","keywords":["machine-learning","ml","neural-network","transformer","matrix","deep-learning","typescript","rust","napi","bpe-tokenizer","sequential","lstm","gru","rnn","attention"],"author":{"name":"Akhyar"},"license":"ISC","_id":"@akhyar11/ml-v1@2.2.8","maintainers":[{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"}],"homepage":"https://github.com/Akhyar11/ML-V1#readme","bugs":{"url":"https://github.com/Akhyar11/ML-V1/issues"},"dist":{"shasum":"f662c20611ea4111cef6acf0e7a668627e6d8d91","tarball":"https://registry.npmjs.org/@akhyar11/ml-v1/-/ml-v1-2.2.8.tgz","fileCount":313,"integrity":"sha512-CQPSpqhUSks3v49dhRxouAlziPDxO8J/0Gt+pyBJNyLKXDvuONB7SEVM4pEcd64fx7qnOEkT0afgvc06ZM9Epw==","signatures":[{"sig":"MEUCIQDmLgTqF6wYre6SOCK0fBT3w8NRpcS+JYQCvwt5s3Z+jwIgPPEAe9pdtMR1rJdyp9v0lQOQGVX2vr6q01dKg5aWRh4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1090842},"main":"dist/index.js","napi":{"name":"ml-native"},"types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.js"},"./native":{"types":"./index.d.ts","default":"./index.js","require":"./index.js"}},"gitHead":"a294ae4c515d6284a766fd8ed80fb52f91cc2cf8","scripts":{"test":"node -r ts-node/register test/index.ts","start":"clear && tsc && time node build/main.js","build:rust":"napi build --platform --release --cargo-cwd src-rust","postinstall":"node -e \"try{require('child_process').execSync('napi build --platform --release --cargo-cwd src-rust',{stdio:'inherit'})}catch(e){console.warn('[ml-v1] Rust build skipped — native acceleration unavailable. Install Rust (https://rustup.rs) and run: npm run build:rust')}\"","build:publish":"rm -rf dist && tsc -p tsconfig.publish.json","prepublishOnly":"npm run build:publish","build:rust:debug":"napi build --platform --cargo-cwd src-rust"},"_npmUser":{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"},"repository":{"url":"git+https://github.com/Akhyar11/ML-V1.git","type":"git"},"_npmVersion":"10.8.2","description":"TypeScript + Rust Native machine learning library. Matrix ops, layers (Dense, Embedding, RNN, LSTM, GRU, MultiHeadAttention, etc), models (Sequential, Transformers), dan BPE tokenizer.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"ts-node":"^10.9.2","@napi-rs/cli":"^2.18.0","@napi-rs/wasm-runtime":"^0.2.4"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^20.11.20"},"_npmOperationalInternal":{"tmp":"tmp/ml-v1_2.2.8_1777243874471_0.7179307674345223","host":"s3://npm-registry-packages-npm-production"}},"2.3.0-alpha.0":{"name":"@akhyar11/ml-v1","version":"2.3.0-alpha.0","keywords":["machine-learning","ml","neural-network","transformer","matrix","deep-learning","typescript","rust","napi","bpe-tokenizer","sequential","lstm","gru","rnn","attention"],"author":{"name":"Akhyar"},"license":"ISC","_id":"@akhyar11/ml-v1@2.3.0-alpha.0","maintainers":[{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"}],"homepage":"https://github.com/Akhyar11/ML-V1#readme","bugs":{"url":"https://github.com/Akhyar11/ML-V1/issues"},"dist":{"shasum":"0ccefd322701c6296aadf25ce8f82b9f4bd58987","tarball":"https://registry.npmjs.org/@akhyar11/ml-v1/-/ml-v1-2.3.0-alpha.0.tgz","fileCount":314,"integrity":"sha512-P9LOoymvaTbpaYBGpaKcVaVM+kpbsAcrOKwznOdPRJl+iM9nFeiplC7TDl1XyM57rkCfo8dK9HpijO2NOHIJJQ==","signatures":[{"sig":"MEUCIQCzox3VSDY4dOFACy7vFe0bznxy9CV7A9Hear7JwrVz5wIgBMewxLRuBb8jtRyJds33xyJ0FreFNPwconF3F2ZqbVQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1177650},"main":"dist/index.js","napi":{"name":"ml-native"},"types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.js"},"./native":{"types":"./index.d.ts","default":"./index.js","require":"./index.js"}},"gitHead":"dcdb8b80d72c8e65d08489f17b8e43635f849f18","scripts":{"test":"node -r ts-node/register test/index.ts","start":"clear && tsc && time node build/main.js","build:rust":"napi build --platform --release --cargo-cwd src-rust","postinstall":"node -e \"try{require('child_process').execSync('napi build --platform --release --cargo-cwd src-rust',{stdio:'inherit'})}catch(e){console.warn('[ml-v1] Rust build skipped - native acceleration unavailable. Install Rust (https://rustup.rs) and run: npm run build:rust')}\"","build:publish":"rm -rf dist && tsc -p tsconfig.publish.json","prepublishOnly":"npm run build:publish","build:rust:debug":"napi build --platform --cargo-cwd src-rust"},"_npmUser":{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"},"repository":{"url":"git+https://github.com/Akhyar11/ML-V1.git","type":"git"},"_npmVersion":"10.8.2","description":"TypeScript + Rust Native machine learning library. Matrix ops, layers (Dense, Embedding, RNN, LSTM, GRU, MultiHeadAttention, etc), models (Sequential, Transformers), dan BPE tokenizer.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"ts-node":"^10.9.2","@napi-rs/cli":"^2.18.0","@changesets/cli":"^2.31.0","@napi-rs/wasm-runtime":"^0.2.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@types/node":"^20.11.20"},"_npmOperationalInternal":{"tmp":"tmp/ml-v1_2.3.0-alpha.0_1777265363297_0.3329684736411558","host":"s3://npm-registry-packages-npm-production"}},"2.3.0-alpha.1":{"name":"@akhyar11/ml-v1","version":"2.3.0-alpha.1","keywords":["machine-learning","ml","neural-network","transformer","matrix","deep-learning","typescript","rust","napi","bpe-tokenizer","sequential","lstm","gru","rnn","attention"],"author":{"name":"Akhyar"},"license":"ISC","_id":"@akhyar11/ml-v1@2.3.0-alpha.1","maintainers":[{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"}],"homepage":"https://github.com/Akhyar11/ML-V1#readme","bugs":{"url":"https://github.com/Akhyar11/ML-V1/issues"},"dist":{"shasum":"87bf41574e33350b8e0c241fc2b59911baf3a8db","tarball":"https://registry.npmjs.org/@akhyar11/ml-v1/-/ml-v1-2.3.0-alpha.1.tgz","fileCount":318,"integrity":"sha512-A+2UPPpOCTY+TD36L9RC0eS6iiA6TdP3sbruqpC+3mhRkNNEGHE1HOLkijHLxQtiYVWpy2gSsWfIgNSGz2eVaw==","signatures":[{"sig":"MEQCIGrVBf12eSg81k253uKEOmo6M7nmLjIp/Yhcx88uanJEAiBdvXn0qehNh+8GH5b3/xqWtc9h29bNObEwPCtJnrwDKg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1300437},"main":"dist/index.js","napi":{"name":"ml-native"},"types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.js"},"./native":{"types":"./index.d.ts","default":"./index.js","require":"./index.js"}},"gitHead":"b1a2e1c9e7cc7a491af43c7a6bc3030b8e48700d","scripts":{"test":"node -r ts-node/register test/index.ts","start":"clear && tsc && time node build/main.js","build:rust":"napi build --platform --release --cargo-cwd src-rust","postinstall":"node -e \"try{require('child_process').execSync('napi build --platform --release --cargo-cwd src-rust',{stdio:'inherit'})}catch(e){console.warn('[ml-v1] Rust build skipped - native acceleration unavailable. Install Rust (https://rustup.rs) and run: npm run build:rust')}\"","build:publish":"rm -rf dist && tsc -p tsconfig.publish.json","prepublishOnly":"npm run build:publish","build:rust:debug":"napi build --platform --cargo-cwd src-rust"},"_npmUser":{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"},"repository":{"url":"git+https://github.com/Akhyar11/ML-V1.git","type":"git"},"_npmVersion":"10.8.2","description":"TypeScript + Rust Native machine learning library. Matrix ops, layers (Dense, Embedding, RNN, LSTM, GRU, MultiHeadAttention, etc), models (Sequential, Transformers), dan BPE tokenizer.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"ts-node":"^10.9.2","@napi-rs/cli":"^2.18.0","@changesets/cli":"^2.31.0","@napi-rs/wasm-runtime":"^0.2.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@types/node":"^20.11.20"},"_npmOperationalInternal":{"tmp":"tmp/ml-v1_2.3.0-alpha.1_1777279411868_0.08501739374269879","host":"s3://npm-registry-packages-npm-production"}},"2.3.0-alpha.2":{"name":"@akhyar11/ml-v1","version":"2.3.0-alpha.2","keywords":["machine-learning","ml","neural-network","transformer","matrix","deep-learning","typescript","rust","napi","bpe-tokenizer","sequential","lstm","gru","rnn","attention"],"author":{"name":"Akhyar"},"license":"ISC","_id":"@akhyar11/ml-v1@2.3.0-alpha.2","maintainers":[{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"}],"homepage":"https://github.com/Akhyar11/ML-V1#readme","bugs":{"url":"https://github.com/Akhyar11/ML-V1/issues"},"dist":{"shasum":"700cda2846138bcdfb307ef1547f92d304ffc4ae","tarball":"https://registry.npmjs.org/@akhyar11/ml-v1/-/ml-v1-2.3.0-alpha.2.tgz","fileCount":318,"integrity":"sha512-iCUSwG4HA9X2ULmd8VRUE8fWFL67+8645m+oZkMsNYwCXqnZz4mHpBG4Pyno2haYWTh0+34m+N6dkBkBknjqbQ==","signatures":[{"sig":"MEYCIQCX8C0Am5DFRCczM1hAwKT2FZNN3MFguD4qCria+/0O3QIhAL2e3FF1qQScyky9qFd8YXypwvRm0ZHjBrEZ4uEc7oRB","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1300609},"main":"dist/index.js","napi":{"name":"ml-native"},"types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.js"},"./native":{"types":"./index.d.ts","default":"./index.js","require":"./index.js"}},"gitHead":"63647da51a873fca18753ab3567ac3c10e512b94","scripts":{"test":"node -r ts-node/register test/index.ts","start":"clear && tsc && time node build/main.js","build:rust":"napi build --platform --release --cargo-cwd src-rust","postinstall":"node -e \"try{require('child_process').execSync('napi build --platform --release --cargo-cwd src-rust',{stdio:'inherit'})}catch(e){console.warn('[ml-v1] Rust build skipped - native acceleration unavailable. Install Rust (https://rustup.rs) and run: npm run build:rust')}\"","build:publish":"rm -rf dist && tsc -p tsconfig.publish.json","prepublishOnly":"npm run build:publish","build:rust:debug":"napi build --platform --cargo-cwd src-rust"},"_npmUser":{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"},"repository":{"url":"git+https://github.com/Akhyar11/ML-V1.git","type":"git"},"_npmVersion":"10.8.2","description":"TypeScript + Rust Native machine learning library. Matrix ops, layers (Dense, Embedding, RNN, LSTM, GRU, MultiHeadAttention, etc), models (Sequential, Transformers), dan BPE tokenizer.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"ts-node":"^10.9.2","@napi-rs/cli":"^2.18.0","@changesets/cli":"^2.31.0","@napi-rs/wasm-runtime":"^0.2.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@types/node":"^20.11.20"},"_npmOperationalInternal":{"tmp":"tmp/ml-v1_2.3.0-alpha.2_1777281688074_0.808931144002309","host":"s3://npm-registry-packages-npm-production"}},"2.3.0-alpha.3":{"name":"@akhyar11/ml-v1","version":"2.3.0-alpha.3","keywords":["machine-learning","ml","neural-network","transformer","matrix","deep-learning","typescript","rust","napi","bpe-tokenizer","sequential","lstm","gru","rnn","attention"],"author":{"name":"Akhyar"},"license":"ISC","_id":"@akhyar11/ml-v1@2.3.0-alpha.3","maintainers":[{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"}],"homepage":"https://github.com/Akhyar11/ML-V1#readme","bugs":{"url":"https://github.com/Akhyar11/ML-V1/issues"},"dist":{"shasum":"28f1a9cbda8e5efa413718fb8e7d2f1df8058b3a","tarball":"https://registry.npmjs.org/@akhyar11/ml-v1/-/ml-v1-2.3.0-alpha.3.tgz","fileCount":318,"integrity":"sha512-zIYTEVjwodC28/a6UGApcRaP8OUvIg0gG4/KCQg5BcAQ/Bm2ecK3x3lA00JU0VbkHWguwZULIVr1TSP0zuOx8Q==","signatures":[{"sig":"MEUCIFH0232yD3qbnNpmbs/AyeZ6qzLJoTmQbEGFCtNXHKogAiEA3b9gJEwxEjdwrW7tNfPbHmnDpdsjo5qaZ9L/cuxiJ3Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1300223},"main":"dist/index.js","napi":{"name":"ml-native"},"types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.js"},"./native":{"types":"./index.d.ts","default":"./index.js","require":"./index.js"}},"gitHead":"4109a7cc5edf1936ea8e4848f796ec911bad8834","scripts":{"test":"node -r ts-node/register test/index.ts","start":"clear && tsc && time node build/main.js","build:rust":"napi build --platform --release --cargo-cwd src-rust","postinstall":"node -e \"try{require('child_process').execSync('napi build --platform --release --cargo-cwd src-rust',{stdio:'inherit'})}catch(e){console.warn('[ml-v1] Rust build skipped - native acceleration unavailable. Install Rust (https://rustup.rs) and run: npm run build:rust')}\"","build:publish":"rm -rf dist && tsc -p tsconfig.publish.json","prepublishOnly":"npm run build:publish","build:rust:debug":"napi build --platform --cargo-cwd src-rust"},"_npmUser":{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"},"repository":{"url":"git+https://github.com/Akhyar11/ML-V1.git","type":"git"},"_npmVersion":"10.8.2","description":"TypeScript + Rust Native machine learning library. Matrix ops, layers (Dense, Embedding, RNN, LSTM, GRU, MultiHeadAttention, etc), models (Sequential, Transformers), dan BPE tokenizer.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"ts-node":"^10.9.2","@napi-rs/cli":"^2.18.0","@changesets/cli":"^2.31.0","@napi-rs/wasm-runtime":"^0.2.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@types/node":"^20.11.20"},"_npmOperationalInternal":{"tmp":"tmp/ml-v1_2.3.0-alpha.3_1777282664501_0.9204057901798157","host":"s3://npm-registry-packages-npm-production"}},"2.3.0":{"name":"@akhyar11/ml-v1","version":"2.3.0","description":"TypeScript + Rust Native machine learning library. Matrix ops, layers (Dense, Embedding, RNN, LSTM, GRU, MultiHeadAttention, etc), models (Sequential, Transformers), dan BPE tokenizer.","napi":{"name":"ml-native"},"main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.js","default":"./dist/index.js"},"./native":{"types":"./index.d.ts","require":"./index.js","default":"./index.js"}},"scripts":{"test":"node -r ts-node/register test/index.ts","start":"clear && tsc && time node build/main.js","build:rust":"napi build --platform --release --cargo-cwd src-rust","build:rust:debug":"napi build --platform --cargo-cwd src-rust","build:publish":"rm -rf dist && tsc -p tsconfig.publish.json","prepublishOnly":"npm run build:publish","postinstall":"node -e \"try{require('child_process').execSync('napi build --platform --release --cargo-cwd src-rust',{stdio:'inherit'})}catch(e){console.warn('[ml-v1] Rust build skipped — native acceleration unavailable. Install Rust (https://rustup.rs) and run: npm run build:rust')}\""},"keywords":["machine-learning","ml","neural-network","transformer","matrix","deep-learning","typescript","rust","napi","bpe-tokenizer","sequential","lstm","gru","rnn","attention"],"author":{"name":"Akhyar"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/Akhyar11/ML-V1.git"},"homepage":"https://github.com/Akhyar11/ML-V1#readme","bugs":{"url":"https://github.com/Akhyar11/ML-V1/issues"},"engines":{"node":">=18.0.0"},"devDependencies":{"@types/node":"^20.11.20"},"dependencies":{"@napi-rs/cli":"^2.18.0","ts-node":"^10.9.2","@napi-rs/wasm-runtime":"^0.2.4"},"_id":"@akhyar11/ml-v1@2.3.0","gitHead":"9f12bd79bbc71a9b127a6245773115cda8d71eaf","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-5mGjbbmz6CQQGkFjk8Tk2vB1MpBS5h7ur36q/vgmiR4W3ajGMbRf9RQ97lPJA+2lN2v7RMjA+V80wJlodo9mlw==","shasum":"7cb7ca23c15c954b73dbcb5862805136d88c724d","tarball":"https://registry.npmjs.org/@akhyar11/ml-v1/-/ml-v1-2.3.0.tgz","fileCount":314,"unpackedSize":1193727,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFMejkl7XhVX94YSA5yyXXAwrQQOxthkFABxCRm0nPjXAiA5qp6jWw7PSmlk2IQNtnPllV69t6cuOA5WNFJ0z5BfkQ=="}]},"_npmUser":{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"},"directories":{},"maintainers":[{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ml-v1_2.3.0_1777305229688_0.07299262255493755"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-25T04:29:19.221Z","modified":"2026-04-27T15:53:49.982Z","2.2.5":"2026-04-25T04:29:19.485Z","2.2.6":"2026-04-25T06:37:13.615Z","2.2.7":"2026-04-25T14:46:51.758Z","2.2.8":"2026-04-26T22:51:14.679Z","2.3.0-alpha.0":"2026-04-27T04:49:23.536Z","2.3.0-alpha.1":"2026-04-27T08:43:32.039Z","2.3.0-alpha.2":"2026-04-27T09:21:28.209Z","2.3.0-alpha.3":"2026-04-27T09:37:44.717Z","2.3.0":"2026-04-27T15:53:49.878Z"},"bugs":{"url":"https://github.com/Akhyar11/ML-V1/issues"},"author":{"name":"Akhyar"},"license":"ISC","homepage":"https://github.com/Akhyar11/ML-V1#readme","keywords":["machine-learning","ml","neural-network","transformer","matrix","deep-learning","typescript","rust","napi","bpe-tokenizer","sequential","lstm","gru","rnn","attention"],"repository":{"type":"git","url":"git+https://github.com/Akhyar11/ML-V1.git"},"description":"TypeScript + Rust Native machine learning library. Matrix ops, layers (Dense, Embedding, RNN, LSTM, GRU, MultiHeadAttention, etc), models (Sequential, Transformers), dan BPE tokenizer.","maintainers":[{"name":"akhyar11","email":"akhyarsafrudin@gmail.com"}],"readme":"# ML-V1\n\n> A TypeScript + Rust Native machine learning library — Matrix operations, neural network layers, Transformer models, and a BPE tokenizer, all in one package.\n\n[![npm version](https://img.shields.io/npm/v/@akhyar11/ml-v1?style=flat-square)](https://www.npmjs.com/package/@akhyar11/ml-v1)\n[![License: ISC](https://img.shields.io/badge/License-ISC-blue?style=flat-square)](https://opensource.org/licenses/ISC)\n[![Node.js >=18](https://img.shields.io/badge/node-%3E%3D18-brightgreen?style=flat-square)](https://nodejs.org)\n\n---\n\n## What is ML-V1?\n\n**ML-V1** is a low-to-mid-level machine learning library built with TypeScript and accelerated by a Rust native backend (via [napi-rs](https://napi.rs/)). It gives you full control over every detail of the training loop — shapes, parameter updates, and custom architectures — without depending on a large ML framework.\n\n**Why ML-V1?**\n- Full manual control over training loops, tensor shapes, and parameter updates.\n- A research playground for custom model architectures.\n- The productivity of TypeScript combined with Rust performance on hot paths.\n- Graceful fallback to pure JavaScript when the native backend is unavailable.\n\n---\n\n## Features\n\n- **`Matrix`** — flat `Float32Array`-backed tensor with zero-copy hot-path access via `_data`.\n- **Math primitives** — `dotProduct`, `add`, `sub`, `sumAxis`, `clipGradients`, and more; automatically dispatched to Rust or JS.\n- **Layers** — `Dense`, `Embedding`, `RNN`, `LSTM`, `GRU`, `SelfAttention`, `MultiHeadAttention`, `LayerNormalization`, `Dropout`, `PositionalEncoding`, `Flatten`, `Convolution`.\n- **Models** — `Sequential`, `Transformers` (causal LM), `DimentionalityReduction`.\n- **BPE Tokenizer** — train, incremental update, Unicode-aware pre-tokenization, encode/decode with special tokens, padding, and JSON save/load.\n- **Rust-accelerated ops** — dot-product, activations, LayerNorm, embedding lookup, attention, and optimizer updates; auto-fallback to JS when unavailable.\n- **Dynamic padding trim** (`trimPadding`) — reduces effective sequence length per batch, cutting attention cost from O(seqLen²) to O(effectiveSeqLen²).\n\n---\n\n## Installation\n\n```bash\nnpm install @akhyar11/ml-v1\n```\n\n### Prerequisites for Native Acceleration\n\nThe library works out of the box with a pure JavaScript fallback. For up to **10× faster** matrix operations, install the Rust toolchain so the native addon can be compiled automatically on `npm install`:\n\n1. **Rust Toolchain** — install via [rustup.rs](https://rustup.rs/).\n2. **C/C++ Build Tools** — required by the native binding compiler (e.g. `build-essential` on Linux, Xcode CLI on macOS, MSVC on Windows).\n\n> **Note:** If Rust is not installed, a warning is printed and the library falls back to pure JavaScript automatically. Performance will be noticeably slower for large models.\n\n---\n\n## Building from Source\n\nIf you cloned the repository or need a manual build:\n\n```bash\n# Install dependencies\nnpm install\n\n# Build the native Rust addon (release mode)\nnpm run build:rust\n\n# Build the TypeScript distribution\nnpm run build:publish\n```\n\n---\n\n## Rust Native Backend\n\nThe native backend is loaded by `src/math/rust_backend.ts`. You can check whether it is active at runtime:\n\n```ts\nimport { isNativeAvailable } from \"@akhyar11/ml-v1\";\nconsole.log(\"Native active:\", isNativeAvailable());\n```\n\nTo force JavaScript-only execution (useful for debugging or regression comparisons):\n\n```bash\nML_DISABLE_NATIVE=1 node your-script.js\n```\n\n---\n\n## Quick Start\n\nTrain a simple XOR classifier in a few lines:\n\n```ts\nimport { Dense, mj, Sequential } from \"@akhyar11/ml-v1\";\n\nconst model = new Sequential({\n  layers: [\n    new Dense({ units: 2, outputUnits: 4, activation: \"relu\", status: \"input\" }),\n    new Dense({ units: 4, outputUnits: 1, activation: \"sigmoid\", status: \"output\", loss: \"mse\" }),\n  ],\n});\n\nmodel.compile({ alpha: 0.01, optimizer: \"adam\", error: \"mse\" });\n\nconst X = [mj.matrix([[0], [0]]), mj.matrix([[0], [1]]), mj.matrix([[1], [0]]), mj.matrix([[1], [1]])];\nconst Y = [mj.matrix([[0]]), mj.matrix([[1]]), mj.matrix([[1]]), mj.matrix([[0]])];\n\nconst result = model.fit(X, Y, 200, {\n  batchSize: 4,\n  validationSplit: 0.25,\n  earlyStoppingPatience: 10,\n  verbose: true,\n  onEpochEnd: (epoch, loss, valLoss) => {\n    console.log(`epoch=${epoch} loss=${loss} valLoss=${valLoss}`);\n  },\n});\nconsole.log(\"best\", result.bestEpoch, result.bestLoss);\nconst pred = model.predict(mj.matrix([[1], [0]]));\npred.print();\n```\n\nA legacy callback overload is also supported for backward compatibility:\n\n```ts\nmodel.fit(X, Y, 200, (loss) => console.log(\"loss\", loss));\n```\n\n---\n\n## Examples\n\n### Matrix & Math Operations\n\n```ts\nimport { mj } from \"@akhyar11/ml-v1\";\n\nconst a = mj.matrix([[1, 2], [3, 4]]);\nconst b = mj.matrix([[5, 6], [7, 8]]);\nconst c = mj.dotProduct(a, b);\nconst d = mj.add(c, 1);\nconsole.log(c._shape, d._shape);\n```\n\n### BPE Tokenizer\n\n```ts\nimport { BPETokenizer } from \"@akhyar11/ml-v1\";\n\nconst tokenizer = new BPETokenizer({ vocabSize: 120, minFrequency: 2 });\ntokenizer.train([\"hello world\", \"hello there\"]);\nconst ids = tokenizer.encodeWithSpecial(\"hello world\");\nconst padded = tokenizer.padSequence(ids, 12);\nconsole.log(ids, padded, tokenizer.decode(ids));\n```\n\n### Unicode and Multilingual Tokenization\n\nML-V1 supports custom and built-in pre-tokenizers for non-Latin text. The default is still `\"char\"` for backward compatibility; use `\"unicode-grapheme\"` or `\"script-aware\"` for multilingual corpora.\n\nSupported modes:\n- `char`\n- `unicode-grapheme`\n- `unicode-word`\n- `whitespace`\n- `script-aware`\n\n```ts\nimport { BPETokenizer } from \"@akhyar11/ml-v1\";\n\nconst tokenizer = new BPETokenizer({\n  vocabSize: 1000,\n  preTokenizer: \"script-aware\"\n});\n\ntokenizer.train([\n  \"hello world\",\n  \"مرحبا بالعالم\",\n  \"こんにちは世界\",\n  \"你好世界\",\n  \"ภาษาไทย\",\n  \"한국어테스트\",\n  \"ꦱꦺꦴꦥꦺꦴ\",\n  \"x² + y² = z²\",\n  \"hello ꦱꦺꦴꦥꦺꦴ 😊 你好\"\n]);\n```\n\nBPE alone is not enough for every writing system. Pre-tokenization is important for scripts without spaces, combining marks, emoji sequences, and mixed text. `script-aware` is a general built-in mode; for language-specific behavior, pass a custom `(text: string) => string[]` pre-tokenizer. `Intl.Segmenter` improves grapheme and word segmentation when the runtime supports it. Fallback behavior is deterministic but may be less linguistically accurate.\n\n### Transformer Causal LM — Training\n\n```ts\nimport { mj, Transformers } from \"@akhyar11/ml-v1\";\n\nconst model = new Transformers({ units: 64, seqLen: 8, vocabSize: 500, heads: 8, alpha: 0.001, padTokenId: 0 });\nmodel.compile({ alpha: 0.001, optimizer: \"adam\", error: \"softmaxCrossEntropy\" });\nmodel.train();\n\nconst x = mj.matrix([[0], [0], [10], [20], [30], [40], [50], [60]]); // shape [seqLen, 1]\nconst y = mj.matrix([[0], [10], [20], [30], [40], [50], [60], [0]]); // shifted targets [seqLen, 1]\n\nconst logits = model.forward(x); // shape [vocabSize, seqLen * batch]\nmodel.backward(y);\nconsole.log(\"shape\", logits._shape, \"loss\", model.loss);\n```\n\n### Transformer — Generation / Inference\n\n```ts\nimport { mj, Transformers } from \"@akhyar11/ml-v1\";\n\nconst model = new Transformers({\n  units: 64,\n  seqLen: 8,\n  vocabSize: 500,\n  heads: 8,\n  alpha: 0.001,\n  padTokenId: 0,\n  predictMode: \"next-token\",\n});\nmodel.eval();\n\nconst x = mj.matrix([[0], [0], [10], [20], [30], [40], [50], [60]]);\nconst nextTokenLogits = model.predict(x); // shape [vocabSize, batch]\nmodel.setPredictMode(\"full-sequence\");\nconst fullSequenceLogits = model.predict(x); // shape [vocabSize, seqLen * batch]\n```\n\n---\n\n## API Overview\n\n### Models\n\n| Model | Description |\n|---|---|\n| `Sequential` | Generic layer stack (Dense, Embedding, Attention, CNN, etc.). |\n| `Transformers` | Multi-block causal language model. Supports `numBlocks >= 1`, full-sequence training, and configurable `predictMode` (`\"next-token\"` / `\"full-sequence\"`). |\n| `DimentionalityReduction` | Extends `Sequential` with an encoder/decoder split via the `outputReduction` layer status. |\n\n### Layers\n\n| Layer | Description |\n|---|---|\n| `Dense` | Fully-connected layer with activation, optimizer, and loss handling. |\n| `Embedding` | Token-ID-to-vector lookup with `resize()` support. |\n| `LayerNormalization` | Per-column/token normalization. |\n| `Dropout` | Active only during training mode. |\n| `PositionalEncoding` | Fixed sinusoidal positional encoding. |\n| `MultiHeadAttention` / `SelfAttention` | Causal attention mask with padding support. |\n| `RNN` / `LSTM` / `GRU` | Recurrent sequence modeling with BPTT, gradient clipping, save/load, and stateful mode. `returnSequences` is supported; `returnState` is not yet supported and will throw explicitly. |\n| `Flatten` / `Convolution` | Standard CNN building blocks. |\n\n### Tokenizer\n\n`BPETokenizer` supports:\n\n| Method | Description |\n|---|---|\n| `train(corpus)` | Initial BPE training on a string array. |\n| `update(corpus)` | Incremental vocabulary update without retraining from scratch. |\n| `encode(text)` / `encodeWithSpecial(text)` | Encode text to token IDs, with or without special tokens. |\n| `decode(ids)` | Convert token IDs back to text. |\n| `padSequence(ids, length)` | Pad or truncate a sequence to a fixed length. |\n| `save(path)` / `load(path)` | Persist and restore the tokenizer as a JSON file. |\n\nTokenizer options:\n\n```ts\ntype PreTokenizer = (text: string) => string[];\n\ntype BuiltInPreTokenizer =\n  | \"char\"\n  | \"unicode-grapheme\"\n  | \"unicode-word\"\n  | \"whitespace\"\n  | \"script-aware\";\n\ntype BPETokenizerOptions = {\n  vocabSize?: number;\n  minFrequency?: number;\n  preTokenizer?: BuiltInPreTokenizer | PreTokenizer;\n};\n```\n\nBuilt-in pre-tokenizer names are saved in tokenizer JSON files. Custom pre-tokenizer functions are not serialized; saved metadata records `\"custom\"`, and the same function must be passed again to `BPETokenizer.load(path, { preTokenizer })`.\n\n---\n\n## Core Concepts\n\n- **Shape convention:** most layers use `[rows, cols]`; batched Transformer inputs use column-sequence layout `[seqLen, batchSize]`.\n- **Recurrent convention:** recurrent layers expect a single sequence sample with shape `[features, seqLen]`. The generic `Sequential.fit()` does not batch recurrent sequences yet — use `batchSize: 1`.\n- **Sparse classification targets:** use `softmaxCrossEntropy` with a dense output layer and a target of shape `[1, batch]` containing class indices.\n- **Training / eval mode:** call `model.train()` before training and `model.eval()` before inference. Layers like `Dropout` respect this flag.\n\n---\n\n## Training Workflow\n\n1. Prepare data as `Matrix` inputs and targets.\n2. Build your model and add layers.\n3. Call `model.compile({ alpha, optimizer, error })`.\n4. Run `model.fit()` (high-level) or loop `forward()` → `backward()` manually.\n5. Save the model and tokenizer with `save()`.\n\n## Inference Workflow\n\n1. Load the model and tokenizer.\n2. Convert input text to token IDs and pad to `seqLen`.\n3. Call `model.predict()` (respects `predictMode` for `Transformers`) or `model.forward()`.\n4. Extract the argmax or raw logits as required by your task.\n5. Decode token IDs back to text for NLP tasks.\n\n---\n\n## Performance Notes\n\n- The Rust backend accelerates dot-product, activations, LayerNorm, embedding lookup, attention, and optimizer hot paths.\n- `Matrix` uses `Float32Array` to minimize allocation overhead. Use `_data` directly in hot paths.\n- Several layers use pre-allocated output buffers to reduce garbage collection pressure.\n- **Dynamic padding trim** (`trimPadding: true`, the default) reduces `effectiveSeqLen` per batch, cutting attention cost from O(seqLen²) to O(effectiveSeqLen²) and output projection cost from `vocabSize × seqLen × batch` to `vocabSize × effectiveSeqLen × batch`.\n\n---\n\n## Dynamic Padding Trim (v2.2.0+)\n\nWhen training a Transformer on long-context sequences (e.g. `seqLen=1024`), enable `trimPadding` to avoid paying the full quadratic attention cost on padding tokens:\n\n```ts\nimport { Transformers } from \"@akhyar11/ml-v1\";\n\nconst model = new Transformers({\n  units: 64,\n  seqLen: 1024,\n  vocabSize: 5000,\n  heads: 8,\n  numBlocks: 2,\n  padTokenId: 0\n});\n\n// Right-padding (recommended for new datasets)\nmodel.fit(trainX, trainY, 80, {\n  batchSize: 8,\n  trimPadding: true,\n  paddingSide: \"right\",\n  shuffle: true\n});\n\n// Left-padding (for datasets already padded on the left)\nmodel.fit(trainX, trainY, 80, {\n  batchSize: 8,\n  trimPadding: true,\n  paddingSide: \"left\",\n  shuffle: true\n});\n```\n\n**Options:**\n- `trimPadding: true` *(default)* — enabled automatically.\n- `paddingSide: \"right\"` *(default)* — trailing PAD tokens are trimmed; `positionOffset` is 0.\n- `paddingSide: \"left\"` — leading PAD tokens are trimmed; `positionOffset` is adjusted so that positional encodings for real tokens remain unchanged.\n- `trimPadding: false` — disables the feature entirely.\n- Only applies to full-sequence targets with shape `[seqLen, batch]`. Legacy targets with shape `[1, batch]` are not trimmed.\n\n---\n\n## Best Practices\n\n- Use `softmaxCrossEntropy` for sparse token classification tasks.\n- Keep `seqLen` consistent between your preprocessing pipeline and the model constructor.\n- Set `padTokenId` in both the tokenizer and the model's `Embedding` layer.\n- For `Transformers`, prepare shifted next-token targets with shape `[seqLen, batch]` and fill invalid positions with `padTokenId`.\n- Call `model.train()` before training and `model.eval()` before inference.\n- For Transformer inference, use `model.predict()` as the primary entry point and set `predictMode` to `\"next-token\"` or `\"full-sequence\"` as needed.\n- For stateful recurrent models, avoid `shuffle: true` and `validationSplit > 0` in the generic `Sequential.fit()` loop.\n- Start debugging with `ML_DISABLE_NATIVE=1` when comparing JS vs. native behavior.\n- If loss does not decrease, verify tensor shapes at every layer boundary.\n\n---\n\n## Troubleshooting\n\n| Problem | Solution |\n|---|---|\n| `Native backend not available` | Run `npm run build:rust`, or verify that the `.node` binary matches your current platform. |\n| Shape mismatch in dot product | Check that dimensions satisfy `[aRows × aCols] · [bRows × bCols]` where `aCols === bRows`. |\n| Loss is `NaN` or `Inf` | Reduce the learning rate `alpha`, verify target format, and check for out-of-range token IDs in the embedding. |\n\n---\n\n## Project Structure\n\n```text\nsrc/\n  activation/   cost/   optimizer/\n  matrix/        math/\n  layers/        models/\n  tokenizer/\n  utils/\nsrc-rust/\n  src/lib.rs       ← Rust native ops (napi-rs)\ntest/\ndataset/\ndocs/\n```\n\n---\n\n## Architecture Overview\n\n| Module | Role |\n|---|---|\n| `src/matrix` | Core `Matrix` data structure (`Float32Array`-backed). |\n| `src/math` | Numeric primitives + adaptive Rust/JS dispatch. |\n| `src/activation`, `src/cost`, `src/optimizer` | Training building blocks. |\n| `src/layers` | Neural network layer implementations. |\n| `src/models` | High-level model compositions. |\n| `src/tokenizer` | Text preprocessing (BPE). |\n| `src-rust` | Native ops compiled via `napi-rs`. |\n\n---\n\n## Benchmark & Testing\n\n- Full test + benchmark entry point: [`test/index.ts`](./test/index.ts) — run with `npm test`.\n- Correctness suite: [`test/correctness/index.ts`](./test/correctness/index.ts).\n- Synthetic benchmark suite: [`test/benchmark/index.ts`](./test/benchmark/index.ts).\n- Recurrent model benchmarks: [`test/benchmark/testFamilyRnn.test.ts`](./test/benchmark/testFamilyRnn.test.ts).\n- Transformer mode benchmarks: [`test/benchmark/testFamilyTransformers.test.ts`](./test/benchmark/testFamilyTransformers.test.ts).\n- Benchmark history: [`docs/benchmark-sintetis/README.md`](./docs/benchmark-sintetis/README.md).\n- Correctness history: [`docs/correctness/README.md`](./docs/correctness/README.md).\n\n---\n\n## 📖 Documentation\n\nFor in-depth guides, see the official documentation:\n\n1. **[Overview & Philosophy](docs/GUIDE-LINE/01-overview.md)** — Introduction to the library design and system architecture.\n2. **[Installation & Setup](docs/GUIDE-LINE/02-installation.md)** — How to install and enable Rust native acceleration.\n3. **[Practical Tutorial](docs/GUIDE-LINE/03-tutorial.md)** — Step-by-step guide to building a logic bot and a generative (GPT-style) bot.\n4. **[Full API Reference](docs/api/README.md)** — Technical documentation for Matrix, Math, Layers, Tokenizer, Optimizers, and related APIs.\n\n---\n\n## Versioning\n\nThis project follows `MAJOR.MINOR.PATCH` semantic versioning. The current version is **`2.2.8`**.\n\n- **MAJOR** — breaking changes or major architectural shifts.\n- **MINOR** — new backward-compatible features or improvements.\n- **PATCH** — bug fixes, small optimizations, or minor internal changes.\n\n**Recent changelog:**\n\n| Version | Summary |\n|---|---|\n| `2.2.8` | Full Native Optimizer support (Adam, SGD, AdaGrad, Momentum, NAG) and Sparse Embedding native backend. |\n| `2.2.7` | Unicode-aware BPE pre-tokenizers and multilingual tokenizer documentation. |\n| `2.2.5` | Hot-path optimizations for training/validation, embedding lookup, and BPE tokenizer. |\n| `2.2.4` | `Transformers.predictMode` API ergonomics, docs sync, and correctness suite refactor. |\n| `2.2.3` | Training/inference hot-path optimizations and updated correctness learning snapshots. |\n| `2.2.2` | Combined root suite, family model benchmarks, and correctness learning snapshots. |\n| `2.2.0` | Dynamic padding trim + positional encoding offset. |\n| `2.0.2` | Transformer projector optimizations with no API changes. |\n\n---\n\n## Development & Contributing\n\n```bash\nnpm install          # install dependencies\nnpm run build:rust   # compile the Rust native addon\nnpm test             # run the correctness suite + synthetic benchmark\n```\n\nType-check only (no emit):\n\n```bash\nnpx tsc --noEmit\n```\n\n---\n\n## Roadmap\n\n- Stabilize public API entry points (currently imported directly from `src/*`).\n- Add deterministic floating-point tests.\n- Clean up scripts that reference non-existent project folders.\n- Add dataset recipe documentation and benchmark workflow guides.\n\n---\n\n## License & Credits\n\n- **License:** ISC — see [`package.json`](./package.json).\n- **Native backend:** [`napi-rs`](https://napi.rs/), [`matrixmultiply`](https://crates.io/crates/matrixmultiply), [`rayon`](https://crates.io/crates/rayon).\n- **Issues & feature requests:** use the [GitHub issue tracker](https://github.com/Akhyar11/ML-V1/issues).\n- **Support the project:**\n  [![Saweria](https://img.shields.io/badge/Saweria-Support-orange?style=for-the-badge&logo=saweria)](https://saweria.co/akhyaruhui)\n","readmeFilename":"README.md"}