-

- -

Thursday, January 2, 2020

DeepLearning With TensorFlowJS 2 - Plotting Tensor Data

This tutorial is based on the book Deep Learning With JavaScript (TensorFlowJS).


Tensors

Tensors are the core data structure of TensorFlow.js 

Tensors can also be thought of as containers for numbers.

They are a generalization of vectors and matrices to potentially higher dimensions. 

The number of dimensions and size of each dimension is called the tensor’s shape.
 
Declaring a tensor

// Pass an array of values to create a vector.
tf.tensor([1, 2, 3, 4]).print();

// Pass a nested array of values to make a matrix or a higher
// dimensional tensor.
tf.tensor([[1, 2], [3, 4]]).print();

//Creates rank-1 tf.Tensor with the provided values, shape and dtype.
tf.tensor1d([1, 2, 3]).print();

//Creates rank-2 tf.Tensor with the provided values, shape and dtype.
// Pass a nested array.
tf.tensor2d([[1, 2], [3, 4]]).print();




Plotly.js is a charting library that comes with over 40 chart types, 3D charts, statistical graphs, and SVG maps.





https://codepen.io/tfjs-book/pen/dgQVze

No comments:

Post a Comment