This -

This tutorial is about basic and advanced features of

TensorFlow.js. ThisJavaScriptsoftware library a superset of the native WebGL API, which is available in modern browsers. Applications illustrating this tutorial have been designed fromTensorFlow.jsver. 144. Accordingly, the code in this tutorial will probably not work for older versions.For convenience, all applications are written in

TypeScriptto benefit from type checking sinceTensorFlow.jsprovides aTypeScriptsupport.

Installation and basic execution of TensorFlow.js## Rule(s)

- Availability of
TensorFlow.jsin applications either relies on the prior installation ofNode.js(and thusnpm) or by directly downloading the full package from threejs.org. In the former case,TensorFlow.jsrequires execution of the`npm i`

shell command from the`package.json`

location. This file's content establishes the dependencies fromTensorFlow.jsas follows:`"dependencies": { … "three": "^0.144.0" },`

- Common installation in browsers (
`index.html`

file) requires the inclusion of library files plus application files that reuse libraries. Recently,TensorFlow.jsmay be (re)used by means of the`export`

and`import`

JavaScriptclauses, but this approach is appropriate for very new applications built from scratch.- Common execution leads to a template
JavaScriptas shown below.## Example (HTML)

`<script src="js/lib/three.js"></script>`

## Example (

JavaScript)

## Rule(s)

- Normalization (A. VANNIEUWENHUYZE book p. 111) (
TensorFlow.jsbook p. 76)

Ragged tensors https://www.tensorflow.org/guide/ragged_tensor?hl=en overfitting (sur-ajustement) https://towardsdatascience.com/how-to-split-a-tensorflow-dataset-into-train-validation-and-test-sets-526c8dd29438## Train versus test versus validation data

## Rule(s)

- Train data are key inputs of the
`tf.LayersModel.fit`

instance method. By definition, neuronal network (i.e., model) fitting changes weights (randomly defined at neuronal network construction time). After (enough) epochs (epoch number ⧴ hyper-parameter), fitting aims at providing a neuronal network as a reliable calculator for upcoming predictions.- Test data are key inputs of the
`tf.LayersModel.evaluate`

instance method. When fitted, a neuronal network allows predictions, which should lead to test data.`tf.LayersModel.evaluate`

executes the loss functionwithout, compared to`tf.LayersModel.fit`

, changing weights. activation function,e.g., sigmoïde function- Validation data are key inputs of hyper-parameter tuning.
`tf.LayersModel.fit`

can be parameterized such that a percentage of train datais not used⧴ these are validation data.- Model compilation: loss function: error measurement optimization function like
Stochastic Gradient Descent(SGD) changes weights.## Application(s)

- Convulational Neural Network, CNN, ConvNet p.343 (Aurélien VANNIEUWENHUYZE
## Example

Given`front`

as a blue half sphere, compute`mouth_geometry`

(in pink: raw location of a hypothetical mouth) from scratch.## Listing 1 (copy of a subset of faces from source geometry,

i.e.,`front.geometry`

)## Listing 2 (copy of a subset of vertices from source geometry and consistently rearrange dependency between faces and vertices in target geometry ,

i.e.,`mouth_geometry`

)