TensorFlow placeholder matrix

Ads
 

TensorFlow placeholder matrix

Hi,

How to use the multi-dimensional matrix with TensorFlow? I am searching for TensorFlow placeholder matrix with multi dimensions.

Thanks

View Answers

October 2, 2017 at 12:36 PM

Hi,

TensorFlow supports multi-dimensional matrix and it can easily perform various operations on the matrix. In the following example we are defining a multi-dimensional matrix as placeholder and then using it for multiplication.

Here is simple example code:

#Multi dimentional matrix example
import tensorflow as tf
x = tf.placeholder("float", [None, 3])
y = x * 2
sess = tf.Session()
model = tf.global_variables_initializer()
x_data = [[10, 15, 24], [59, 70, 40],]
result = sess.run(y, feed_dict={x: x_data})
print(result)

Above program displays following details when executed:

C:\Users\Dell>python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import tensorflow as tf
>>>
>>> x = tf.placeholder("float", [None, 3])
>>> y = x * 2
>>>
>>> sess = tf.Session()
>>> model = tf.global_variables_initializer()
>>>
>>> x_data = [[10, 15, 24], [59, 70, 40],]
>>>
>>> result = sess.run(y, feed_dict={x: x_data})
>>> print(result)
[[  20.   30.   48.]
 [ 118.  140.   80.]]
>>>
>>>
>>>

Thanks


October 2, 2017 at 12:51 PM

Hi,

You can learn TensorFlow at following urls:

Learn TensorFlow with above tutorials.

Thanks

Ads









Related Tutorials/Questions & Answers:
TensorFlow placeholder matrix
TensorFlow placeholder matrix  Hi, How to use the multi-dimensional matrix with TensorFlow? I am searching for TensorFlow placeholder matrix.... In the following example we are defining a multi-dimensional matrix as placeholder
Variables in TensorFlow
example in TensorFlow. The placeholder is used to pass the values in runtime...; #Placeholder example ... import tensorflow as tf >>> >>>...Variables in TensorFlow - Defining and using variables in TensorFlow
Advertisements
What are features of TensorFlow 1.0?
What are features of TensorFlow 1.0?  Hi, What are features of TensorFlow 1.0? Thanks   Hi, What are features of TensorFlow 1.0? The TensorFlow 1.0 was released in Feb 2017. This version of TensorFlow comes
How to create variable in TensorFlow?
How to create variable in TensorFlow?  Hi, How to create variable in TensorFlow? Thanks   Hi, In TensorFlow you can't use python variable, you have to create the TensorFlow variable to use it with TensorFlow graph
Best TensorFlow Tutorial
Best TensorFlow Tutorial  I want to learn TensorFlow. Where to learn it? Which is the best website to learn TensorFlow? Thanks   Hello, TensorFlow is deep learning neural network concept based machine learning
Example code of adding placeholder in UItextFeild
Example code of adding placeholder in UItextFeild  Ho to add add the placeholder text in UITextField in IOS program programmatically? Thanks   HI, Its easy to add the placeholder in UITextfield programmatically. Here
Is There any online practical tutorial for TensorFlow?
Is There any online practical tutorial for TensorFlow?  Hi, Searching for many examples of TensorFlow. Is There any online practical tutorial for TensorFlow? Thanks   Hi, Here we many example of TensorFlow which you
matrix addition
matrix addition  hai
matrix addition
matrix addition  hai
matrix substraction
matrix substraction  hai
matrix substraction
matrix substraction  hai
What is the best tutorial for TensorFlow beginners?
What is the best tutorial for TensorFlow beginners?  Hi, How to learn TensorFlow easily and in less time? What is the best tutorial for TensorFlow beginners? Thanks   Hi, To learn TensorFlow you should have
How to set placeholder in uitextfield programmatically?
How to set placeholder in uitextfield programmatically?  Can any one tell me about the example code for setting the placeholder in a UITextField programatically? Thanks   HI, Its easy. Use the following code
matrix adddition
matrix adddition   how to write a program matrix addition in java
Which are some good tutorials on TensorFlow?
Which are some good tutorials on TensorFlow?  Hi, I am science graduate and know Java programming language. Now I want to learn TensorFlow programming language. How to go about it and learn TensorFlow in less time. I am
What is the best source to learn TensorFlow?
What is the best source to learn TensorFlow?  Hi, I am from .NET field and want to learn TensorFlow. What is the best source to learn TensorFlow? Thanks   Hi, Don't worry .NET programmers can also learn TensorFlow
Why TensorFlow is called TensorFlow?
Why this programming language is called TensorFlow? Google Brain team... in the previous tutorial "What is TensorFlow?" TensorFlow is open source... development. TensorFlow programming langue uses computational graph which represents
column matrix
column matrix  columan wise total matrix
column matrix
column matrix  columan wise total matrix
TensorFlow Tutorials
TensorFlow tutorials and examples In this section we are providing many tutorials and example of TensorFlow machine learning framework. TensorFlow... large scale machine learning systems. TensorFlow supports CPU, GUP and TPU
What is the best TensorFlow tutorial or course?
What is the best TensorFlow tutorial or course?  Hi, I am finding difficult to learn TensorFlow myself from online tutorials. Is there any good step by step tutorials of TensorFlow? What is the best TensorFlow tutorial
Matrix multiplication
Matrix multiplication  program to read the elements of the given two matrices of order n*n and to perform the matrix multiplication
What is TensorFlow and why big companies are using?
What is TensorFlow and why big companies are using?  Hi, What is TensorFlow? Why are big companies using TensorFlow? Thanks
Where can I find a nice TensorFlow tutorial?
Where can I find a nice TensorFlow tutorial?  Hi, I am beginner in TensorFlow and trying to find nice tutorials of TensorFlow. Where can I find a nice TensorFlow tutorial? Thanks
transpose matrix
integers into the matrix and print the transpose of it. for this program u r given answer but if i entered 2 by 3 matrix it will not give answer ple check it once
Matrix Class
Matrix Class   A class to manage matrices and add them. Create in the driver class two objects of it and use the add method
Matrix Class
Matrix Class   A class to manage matrices and add them. Create in the driver class two objects of it and use the add method
Hello World Program in TensorFlow
Writing and running Hello World Program in TensorFlow After installation of Python and TensorFlow on Windows computer we will proceed with the programming... TensorFlow Hello World program. TensorFlow is machine learning and distributed
Installing TensorFlow on Windows 10
Steps of Installing TensorFlow on Windows 10 TensorFlow programming language... of Windows 10 operating system for installing TensorFlow deep learning software. TensorFlow is deep learning framework from Google and good news
transpose of matrix
transpose of matrix  write a program in java to declare a square matrices 'A' or order n which is less than 20.allow in user to input only positive integers into the matrix and print the transpose
What is TensorFlow?
What is TensorFlow and what is its use? In this article we will discuss about TensorFlow, which is new and very popular programming language. TensorFlow... in clusters to provide fast processing. TensorFlow is programming language from Google

Ads