• Complain

it-ebooks - Tensorflow 101 (sjchoi86)

Here you can read online it-ebooks - Tensorflow 101 (sjchoi86) full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2018, publisher: iBooker it-ebooks, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

it-ebooks Tensorflow 101 (sjchoi86)
  • Book:
    Tensorflow 101 (sjchoi86)
  • Author:
  • Publisher:
    iBooker it-ebooks
  • Genre:
  • Year:
    2018
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Tensorflow 101 (sjchoi86): summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Tensorflow 101 (sjchoi86)" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

it-ebooks: author's other books


Who wrote Tensorflow 101 (sjchoi86)? Find out the surname, the name of the author of the book and a list of all author's works by series.

Tensorflow 101 (sjchoi86) — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Tensorflow 101 (sjchoi86)" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
TensorBoard Usage
TensorBoard Usage
Machine Learing Basics with TensorFlow
Machine Learing Basics with TensorFlow
Multi-Layer Perceptron (MLP)
Multi-Layer Perceptron (MLP)
Convolutional Neural Network (CNN)
Convolutional Neural Network (CNN)
Using Pre-trained Model (VGG)
Using Pre-trained Model (VGG)
Recurrent Neural Network (RNN)
Recurrent Neural Network (RNN)
Word Embedding (Word2Vec)
Word Embedding (Word2Vec)
Auto-Encoder Model
Auto-Encoder Model
Class Activation Map (CAM)
Class Activation Map (CAM)
Table of Contents
  1. 1.1
  2. 1.2
    1. 1.2.1
    2. 1.2.2
    3. 1.2.3
    4. 1.2.4
  3. 1.3
    1. 1.3.1
    2. 1.3.2
    3. 1.3.3
  4. 1.4
    1. 1.4.1
    2. 1.4.2
    3. 1.4.3
    4. 1.4.4
  5. 1.5
    1. 1.5.1
    2. 1.5.2
    3. 1.5.3
    4. 1.5.4
  6. 1.6
    1. 1.6.1
    2. 1.6.2
  7. 1.7
    1. 1.7.1
    2. 1.7.2
    3. 1.7.3
    4. 1.7.4
    5. 1.7.5
  8. 1.8
    1. 1.8.1
    2. 1.8.2
  9. 1.9
    1. 1.9.1
    2. 1.9.2
    3. 1.9.3
  10. 1.10
    1. 1.10.1
  11. 1.11
    1. 1.11.1
    2. 1.11.2
    3. 1.11.3
  12. 1.12
  13. 1.13
  14. 1.14
  15. 1.15
  16. 1.16
  17. 1.17
Generating Custom Dataset
Basic data set generation
import numpy as np import os from scipy.misc import imread, imresize import matplotlib.pyplot as plt%matplotlib inline print ( "Package loaded" ) cwd = os.getcwd() print ( "Current folder is %s" % (cwd) )Package loadedCurrent folder is /home/enginius/github/tensorflow-101/notebooks
SPECIFY THE FOLDER PATHS
+ RESHAPE SIZE + GRAYSCALE
# Training set folder paths = { "../../img_dataset/celebs/Arnold_Schwarzenegger" , "../../img_dataset/celebs/Junichiro_Koizumi" , "../../img_dataset/celebs/Vladimir_Putin" , "../../img_dataset/celebs/George_W_Bush" } # The reshape size imgsize = [, ] # Grayscale use_gray = # Save name data_name = "custom_data" print ( "Your images should be at" ) for i, path in enumerate(paths): print ( " [%d/%d] %s/%s" % (i, len(paths), cwd, path)) print ( "Data will be saved to %s" % (cwd + '/data/' + data_name + '.npz' ))Your images should be at [0/4] /home/enginius/github/tensorflow-101/notebooks/../../img_dataset/celebs/George_W_Bush [1/4] /home/enginius/github/tensorflow-101/notebooks/../../img_dataset/celebs/Arnold_Schwarzenegger [2/4] /home/enginius/github/tensorflow-101/notebooks/../../img_dataset/celebs/Junichiro_Koizumi [3/4] /home/enginius/github/tensorflow-101/notebooks/../../img_dataset/celebs/Vladimir_PutinData will be saved to /home/enginius/github/tensorflow-101/notebooks/data/custom_data.npz
RGB 2 GRAY FUNCTION
def rgb2gray (rgb) : if len(rgb.shape) is : return np.dot(rgb[...,:], [ 0.299 , 0.587 , 0.114 ]) else : # print ("Current Image if GRAY!") return rgb
LOAD IMAGES
nclass = len(paths)valid_exts = [ ".jpg" , ".gif" , ".png" , ".tga" , ".jpeg" ]imgcnt = for i, relpath in zip(range(nclass), paths): path = cwd + "/" + relpath flist = os.listdir(path) for f in flist: if os.path.splitext(f)[].lower() not in valid_exts: continue fullpath = os.path.join(path, f) currimg = imread(fullpath) # Convert to grayscale if use_gray: grayimg = rgb2gray(currimg) else : grayimg = currimg # Reshape graysmall = imresize(grayimg, [imgsize[], imgsize[]])/ grayvec = np.reshape(graysmall, (, -1 )) # Save curr_label = np.eye(nclass, nclass)[i:i+, :] if imgcnt is : totalimg = grayvec totallabel = curr_label else : totalimg = np.concatenate((totalimg, grayvec), axis=) totallabel = np.concatenate((totallabel, curr_label), axis=) imgcnt = imgcnt + print ( "Total %d images loaded." % (imgcnt))Total 681 images loaded.
DIVIDE TOTAL DATA INTO TRAINING AND TEST SET
def print_shape (string, x) : print ( "Shape of '%s' is %s" % (string, x.shape,))randidx = np.random.randint(imgcnt, size=imgcnt)trainidx = randidx[:int(*imgcnt/)]testidx = randidx[int(*imgcnt/):imgcnt]trainimg = totalimg[trainidx, :]trainlabel = totallabel[trainidx, :]testimg = totalimg[testidx, :]testlabel = totallabel[testidx, :]print_shape( "trainimg" , trainimg)print_shape( "trainlabel" , trainlabel)print_shape( "testimg" , testimg)print_shape( "testlabel" , testlabel)Shape of 'trainimg' is (408, 4096)Shape of 'trainlabel' is (408, 4)Shape of 'testimg' is (273, 4096)Shape of 'testlabel' is (273, 4)
SAVE TO NPZ
savepath = cwd + "/data/" + data_name + ".npz" np.savez(savepath, trainimg=trainimg, trainlabel=trainlabel , testimg=testimg, testlabel=testlabel, imgsize=imgsize, use_gray=use_gray) print ( "Saved to %s" % (savepath))Saved to /home/enginius/github/tensorflow-101/notebooks/data/custom_data.npz
LOAD TO CHECK!
# Load them! cwd = os.getcwd()loadpath = cwd + "/data/" + data_name + ".npz" l = np.load(loadpath) # See what's in here l.files # Parse data trainimg_loaded = l[ 'trainimg' ]trainlabel_loaded = l[ 'trainlabel' ]testimg_loaded = l[ 'testimg' ]testlabel_loaded = l[ 'testlabel' ] print ( "%d train images loaded" % (trainimg_loaded.shape[])) print ( "%d test images loaded" % (testimg_loaded.shape[])) print ( "Loaded from to %s" % (savepath))408 train images loaded273 test images loadedLoaded from to /home/enginius/github/tensorflow-101/notebooks/data/custom_data.npz
PLOT RANDOMLY SELECTED TRAIN IMAGES
ntrain_loaded = trainimg_loaded.shape[]batch_size = ;randidx = np.random.randint(ntrain_loaded, size=batch_size) for i in randidx: currimg = np.reshape(trainimg_loaded[i, :], (imgsize[], -1 )) currlabel_onehot = trainlabel_loaded[i, :] currlabel = np.argmax(currlabel_onehot) if use_gray: currimg = np.reshape(trainimg[i, :], (imgsize[], -1 )) plt.matshow(currimg, cmap=plt.get_cmap( 'gray' )) plt.colorbar() else : currimg = np.reshape(trainimg[i, :], (imgsize[], imgsize[], )) plt.imshow(currimg) title_string = "[%d] %d-class" % (i, currlabel) plt.title(title_string) plt.show()

Tensorflow 101 sjchoi86 - photo 1

Tensorflow 101 sjchoi86 - photo 2

Tensorflow 101 sjchoi86 - photo 3

Tensorflow 101 sjchoi86 - photo 4

Tensorflow 101 sjchoi86 - photo 5

Tensorflow 101 sjchoi86 - photo 6

PLOT RANDOMLY SELECTED TES - photo 7

PLOT RANDOMLY SELECTED TEST IMAGES Do batch stuff using loaded data - photo 8

PLOT RANDOMLY SELECTED TEST IMAGES Do batch stuff using loaded data - photo 9

PLOT RANDOMLY SELECTED TEST IMAGES Do batch stuff using loaded data - photo 10

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Tensorflow 101 (sjchoi86)»

Look at similar books to Tensorflow 101 (sjchoi86). We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Tensorflow 101 (sjchoi86)»

Discussion, reviews of the book Tensorflow 101 (sjchoi86) and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.