This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
No comments:
Post a Comment