In [1]:
from __future__ import print_function
import tensorflow as tf
import numpy as np
In [2]:
from datetime import date
date.today()
Out[2]:
In [3]:
author = "kyubyong. https://github.com/Kyubyong/tensorflow-exercises"
In [4]:
tf.__version__
Out[4]:
In [5]:
np.__version__
Out[5]:
In [6]:
sess = tf.InteractiveSession()
NOTE on notation
Q1. Create a tensor of the shape [2, 3] with all elements set to zero.
In [7]:
Q2. Let X be a tensor of [[1,2,3], [4,5,6]].
Create a tensor of the same shape and dtype as X with all elements set to zero.
In [8]:
Q3. Create a tensor of shape [2, 3] with all elements set to one.
In [9]:
Q4. Let X be a tensor of [[1,2,3], [4,5,6]].
Create a tensor of the same shape and dtype as X with all elements set to one.
In [10]:
Q5. Create a tensor of the shape [3, 2], with all elements of 5.
In [11]:
Q6. Create a constant tensor of [[1, 3, 5], [4, 6, 8]], with dtype=float32
In [12]:
Q7. Create a constant tensor of the shape [2, 3], with all elements set to 4.
In [13]:
Q8. Create a 1-D tensor of 50 evenly spaced elements between 5 and 10 inclusive.
In [14]:
Q9. Create a tensor which looks like [10, 12, 14, 16, ..., 100].
In [15]:
Q10. Create a random tensor of the shape [3, 2], with elements from a normal distribution of mean=0, standard deviation=2.
In [16]:
Q11. Create a random tensor of the shape [3, 2], with elements from a normal distribution of mean=0, standard deviation=1 such that any values don't exceed 2 standard deviations from the mean.
In [17]:
Q12. Create a random tensor of the shape [3, 2], with all elements from a uniform distribution that ranges from 0 to 2 (exclusive).
In [18]:
Q13. Let X be a tensor of [[1, 2], [3, 4], [5, 6]]. Shuffle X along its first dimension.
In [19]:
Q14. Let X be a random tensor of the shape [10, 10, 3], with elements from a unit normal distribution. Crop X with the shape of [5, 5, 3].
In [20]:
In [ ]: