Replies: 1 comment 1 reply
-
I don't understand how @tensorflow/tfjs is packaged. Version 1 works fine, but the current version (4) doesn't. # Tensorflow
```js
import * as tf from 'npm:@tensorflow/tfjs@1';
```
```js
// Define a simple model.
const model = tf.sequential();
model.add(tf.layers.dense({units: 100, activation: 'relu', inputShape: [10]}));
model.add(tf.layers.dense({units: 1, activation: 'linear'}));
model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});
const xs = tf.randomNormal([100, 10]);
const ys = tf.randomNormal([100, 1]);
// Train the model.
model.fit(xs, ys, {
epochs: 100,
callbacks: {
onEpochEnd: (epoch, log) => display(`Epoch ${epoch}: loss = ${log.loss}`)
}
});
``` let me know if you find a solution for v4? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Is it possible to use Tensorflow.js in framework? Is there any tutorials somewhere?
Br,JH
Beta Was this translation helpful? Give feedback.
All reactions