in Technology by
Explain the Vector in TensorFlow?

1 Answer

0 votes
by

Vector

An array of numbers, which is either continuous or discrete, is defined as a vector. Machine learning algorithms deal with fixed length vectors for better output generation.

Machine learning algorithms deal with multidimensional data so vectors play a crucial role.

The pictorial representation of vector model is as shown below −

Vector Model

Scalar

Scalar can be defined as one-dimensional vector. Scalars are those, which include only magnitude and no direction. With scalars, we are only concerned with the magnitude.

Examples of scalar include weight and height parameters of children.

Matrix

Matrix can be defined as multi-dimensional arrays, which are arranged in the format of rows and columns. The size of matrix is defined by row length and column length. Following figure shows the representation of any specified matrix.

Multi Dimensional Arrays

Consider the matrix with “m” rows and “n” columns as mentioned above, the matrix representation will be specified as “m*n matrix” which defined the length of matrix as well.

Mathematical Computations

In this section, we will learn about the different Mathematical Computations in TensorFlow.

Addition of matrices

Addition of two or more matrices is possible if the matrices are of the same dimension. The addition implies addition of each element as per the given position.

Consider the following example to understand how addition of matrices works −

Example:A=[1324]B=[5768]thenA+B=[1+53+72+64+8]=[610812]Example:A=[1234]B=[5678]thenA+B=[1+52+63+74+8]=[681012]

Subtraction of matrices

The subtraction of matrices operates in similar fashion like the addition of two matrices. The user can subtract two matrices provided the dimensions are equal.

Example:A[1324]B[5768]thenAB[15372648][4444]Example:A−[1234]B−[5678]thenA−B−[1−52−63−74−8]−[−4−4−4−4]

Multiplication of matrices

For two matrices A m*n and B p*q to be multipliable, n should be equal to p. The resulting matrix is −

C m*q

A=[1324]B=[5768]A=[1234]B=[5678]

c11=[12][57]=1×5+2×7=19c12=[12][68]=1×6+2×8=22c11=[12][57]=1×5+2×7=19c12=[12][68]=1×6+2×8=22

c21=[34][<span style="f

Related questions

0 votes
    What is the name of a data member of class Vector which is used to store a number of elements in the ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    What is the Understanding of Artificial Intelligence TensorFlow?...
asked Nov 3, 2020 in Technology by JackTerrance
0 votes
    What are the steps of TensorFlow - Installation?...
asked Nov 3, 2020 in Technology by JackTerrance
0 votes
0 votes
    What is TensorFlow?...
asked Nov 3, 2020 in Technology by JackTerrance
0 votes
    I'am trying to follow this tutorial: ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    I have a Time series data for almost 5 years. Using this data I want to forecast next 2 years. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    Using tf.data.Dataset API to build a data pipeline, I encountered an error in training: pure virtual method ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 13, 2022 in Education by JackTerrance
0 votes
    I'am trying to follow this tutorial: ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 29, 2022 in Education by JackTerrance
0 votes
    Using up-to-date Keras and Tensorflow on Ubuntu 16.04 and 14.04. For the following code: img2D = ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    When using model.compile(optimizer = tf.train.AdamOptimizer(), loss = 'sparse_categorical_crossentropy', metrics=[' ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 13, 2022 in Education by JackTerrance
0 votes
    I have a DQN all set up and working, but I can't figure out how to display the loss without ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I am trying to implement the tutorial given on Tensorflow tutorial on custom training. Due to some reason ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    Suppose I have a Tensorflow tensor. How do I get the dimensions (shape) of the tensor as integer values? I ... 'Dimension' instead. Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    While training a tensorflow seq2seq model I see the following messages : W tensorflow/core/common_runtime/gpu/pool_allocator ... GB GPU Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
...