"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

August 06, 2019

Day #265 - Python Arrays & Version Check of TF,OpenCV


import tensorflow as tf
# 25 data points
# Each point with 32 random elements in it
z = tf.random.normal([5,5,1,32])
#5 x 5 matrix
#Each 1 x 32
sess = tf.Session()
result = sess.run(z)
print(result.shape)
z = tf.random.normal([2,2,1,3])
sess = tf.Session()
result = sess.run(z)
print(result.shape)
print(result)
import numpy as np
#Reshape 100 elements into 10 batches of 2 x 5
a = np.arange(100).reshape((-1,10,2,5))
print(a)
#Reshape 100 elements into 5 batches of 1 x 20
a = np.arange(100).reshape((-1,5,1,20))
print(a)
#Reshape 100 elements into 20 batches of 1 x 5
a = np.arange(100).reshape((-1,20,1,5))
print(a)
#Reshape 100 elements into 20 batches of 1 x 5
a = np.arange(100).reshape((-1,20,1,5))
b = a.reshape(-1,100)
print(b)
#Versions check - Python
import sys
print("python environment " + str(sys.version_info))
#OpenCV version
import cv2
print("OpenCV version " + str(cv2.__version__))
#Tensorflow version
import tensorflow as tf
print(str(tf.VERSION))
#pip freeze
Happy Learning!!!

No comments: