Monthly archives: December, 2017

Map Reduce in python

Map and Reduce are two powerful methods of Python that is used to solve big logical problems, suppose you have to calculate how many routers are making error in network. So write a single function and map it with list of files. The Reducer will then count the total number of routers. Python Code..

Fibonacci number

In Mathematics, the Fibonacci numbers are the numbers in the following integer sequence called the Fibonacci sequence, and characterized by the fact that every number after the first two is the sum of the two preceding ones: In Python we may write the solution like this.. #Create a list and instantiate it with 0,1 lst=[0,1] #Run a loop …

Types of Tensor

We can define basically three types of tensor: Constant: It is a tensor which will be constant while a graph run there is no need to initialize it. Variable: It is a tensor which will be asynchronously assigned and initiated. Placeholder: It is a tensor which accept value at run time from the feed_dict.

Hello world in Tensorflow

First i want to tell you Tensorflow is not a library to be used as writing a hello world code, but still if you want then go ahead ! So import tensorflow library… import tensorflow as tf hello=tf.constant(‘Hello world’,name=’Hello’,shape=[1]) print(hello)