|
1 | 1 | # TensorFlow.js Example: Abalone Age
|
2 | 2 |
|
3 |
| -This example shows how to predicting the age of abalone from physical measurements under Node.js |
| 3 | +This example shows how to predict the age of abalone from physical measurements using TensorFlow.js with Node.js. |
4 | 4 |
|
5 | 5 | The data set available at [UCI Machine Learning Repository](https://archive.ics.uci.edu/ml/datasets/Abalone).
|
6 | 6 |
|
7 |
| -This example shows how to |
8 |
| -* load a `Dataset` from a local csv file |
9 |
| -* prepare the Dataset for training |
10 |
| -* create a `tf.LayersModel` from scratch |
11 |
| -* train the model through `model.fitDataset()` |
| 7 | +This example shows how to: |
| 8 | +* load a `Dataset` from a local csv file. |
| 9 | +* prepare the Dataset for training. |
| 10 | +* create a `tf.LayersModel` from scratch. |
| 11 | +* train the model through `model.fitDataset()`. |
12 | 12 | * save the trained model to a local folder.
|
13 | 13 |
|
14 |
| -To launch the demo, do |
| 14 | +To launch the demo, run the following command: |
15 | 15 |
|
16 | 16 | ```sh
|
17 | 17 | yarn
|
18 | 18 | yarn train
|
19 | 19 | ```
|
20 | 20 |
|
| 21 | +The result logs 100 Epochs as well as a predicted result similar to the following: |
| 22 | + |
| 23 | +``` |
| 24 | +... |
| 25 | +Epoch 100 / 100 |
| 26 | +eta=0.0 =================================================> |
| 27 | +402ms 57414us/step - loss=7.42 val_loss=5.60 |
| 28 | +The actual test abalone age is 10, the inference result from the model is 11.929240226745605 |
| 29 | +``` |
| 30 | + |
21 | 31 | By default, the training uses tfjs-node, which runs on the CPU.
|
22 | 32 | If you have a CUDA-enabled GPU and have the CUDA and CuDNN libraries
|
23 | 33 | set up properly on your system, you can run the training on the GPU
|
|
0 commit comments