Ad

Saturday, February 16, 2019

FAQ Udacity Deep Learning Nanodegree Project 2 Dog Breed Classifier Convolution Neural Network (CNN)

CODE SNIPPETS

numpy.squeeze
Remove single-dimensional entries from the shape of an array.
Selects a subset of the single-dimensional entries in the shape. If an axis is selected with shape entry greater than one, an error is raised.

>>> import numpy as np
>>> test = np.array([[[1],[3],[1]]])
>>> np.squeeze(test)
array([1, 3, 1])
>>> np.squeeze(test).shape
(3,)

test = np.array([[[1,2],[3,4],[1,5]]])
>>> test2 = np.squeeze(test)
>>> test2
array([[1, 2],
       [3, 4],
       [1, 5]]) 



End of code snippet

No comments:

Post a Comment

React UI, UI UX, Reactstrap React Bootstrap

React UI MATERIAL  Install yarn add @material-ui/icons Reactstrap FORMS. Controlled Forms. Uncontrolled Forms.  Columns, grid