-
Notifications
You must be signed in to change notification settings - Fork 5
My Code doesn't run with tensorscript :-( #1
Comments
Are you using node 10+? |
Also does |
hi @Ulawun are you still having an issue? |
Hi yawetse, Merry Xmas, |
Hi @Ulawun check out #2, you can run without using MJS just require the bundled common JS file Example: const TS = require('tensorscript/bundle/tensorscript.cjs');
const MultipleLinearRegression = TS.MultipleLinearRegression;
const Model = new MultipleLinearRegression({ epoch:100, });
const inputData = [
[ 0, 0, 0, 1, ],
[ 0, 1, 0, 0, ],
[ 0, 0, 0, 1, ]
];
const outputData = [
[ 1, ],
[ 0, ],
[ 1, ]
];
const predictionData = [
[ 0, 1, 0, 0 ],
[ 0, 0, 0, 1 ],
];
Model.train(inputData,outputData)
.then(() => Model.predict(predictionData,{probability: false}))
.then(predictions => {
console.log({ predictions }) //{ predictions: [ [ 0 ], [ 1 ] ] }
})
.catch(err=>console.error(err)); |
Hi Yawetse, Thanks a lot for your answer. From my understanding MultipleLinearRegression Thanks, |
hi @Ulawun feel free to reach out about the math related questions. I'm going to close this issue |
Hello,
Thx for sharing everything.
I can run
$ npm test
without problems :-)
When I start any *.mjs file with
$ node --experimental-modules test.mjs
beginning with
import { MultipleLinearRegression, DeepLearningRegression, } from 'tensorscript';
I get the error:
{ Error: Cannot find module tensorscript
at module.exports (internal/loader/search.js:14:12)
at Loader.exports.resolve [as resolver] (internal/loader/ModuleRequest.js:102:11)
at Loader.resolve (internal/loader/Loader.js:82:40)
at Loader.getModuleJob (internal/loader/Loader.js:112:40)
at ModuleWrap.module.link (internal/loader/ModuleJob.js:36:25)
at link (internal/loader/ModuleJob.js:34:19)
at code: 'MODULE_NOT_FOUND' }
How can I get my test.mjs running ?
Thanks.
The text was updated successfully, but these errors were encountered: