Comments (3)
I'm sorry but I don't understand your question and I cannot find this code in Tutorial 09.
from tensorflow-tutorials.
well it was lesson 9(video data) it was the one_hot_encoded method return statement.
return np.eye(num_classes)[class_numbers]. Could you explain whats going on here?
from tensorflow-tutorials.
It is a fast way of converting class-numbers to one-hot encoded arrays. I think one-hot encoded arrays were explained in one of the early tutorials.
Here's an example:
Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul 2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.eye(10)
array([[ 1., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
[ 0., 1., 0., 0., 0., 0., 0., 0., 0., 0.],
[ 0., 0., 1., 0., 0., 0., 0., 0., 0., 0.],
[ 0., 0., 0., 1., 0., 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 1., 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0., 1., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0., 0., 1., 0., 0., 0.],
[ 0., 0., 0., 0., 0., 0., 0., 1., 0., 0.],
[ 0., 0., 0., 0., 0., 0., 0., 0., 1., 0.],
[ 0., 0., 0., 0., 0., 0., 0., 0., 0., 1.]])
>>> a = np.eye(10)
>>> a[3]
array([ 0., 0., 0., 1., 0., 0., 0., 0., 0., 0.])
>>> a[5]
array([ 0., 0., 0., 0., 0., 1., 0., 0., 0., 0.])
>>> a[[3,5]]
array([[ 0., 0., 0., 1., 0., 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0., 1., 0., 0., 0., 0.]])
from tensorflow-tutorials.
Related Issues (20)
- when i was trying to run this code in pycharm it unables to download inception package and it results to an error ImportError: No module named 'inception' so please help me to overcome on this issue HOT 1
- Tutorial 23: Memory Error HOT 1
- ValueError: Unknown loss function:sparse_cross_entropy HOT 2
- Tutorial 21 Already Exists Error HOT 1
- 23_Time-Series-Prediction.ipynb - Predicting future values when have no test data? HOT 2
- Deprecated scipy libraries HOT 3
- acc = sess.run(accuracy, feed_dict={x: mnist.test.images, y: mnist.test.Lables}) AttributeError: 'DataSet' object has no attribute 'Lables' HOT 2
- using Elmo embedding layer in image captioning model ( Tutorial #22) HOT 1
- Image Caption works poorly HOT 6
- Tutorial 20 ValueError in Keras HOT 3
- TensorFlow 2.0 HOT 3
- Now how to forecast the future without knowing the known values? HOT 2
- AttributeError: module 'tensorflow' has no attribute 'gfile' in style transfer notebook HOT 3
- model.prediction does not match model.evaluation loss error HOT 3
- Tutorial 23 Error: Supplying multiple axes to axis is no longer supported. HOT 1
- ValueError: could not convert string to float: '28-12-2017'. I am training the time series prediction model on stock market data set and faced this error HOT 1
- issue when implementing image caption model HOT 4
- module 'tensorflow.python.ops.variable_scope' has no attribute '_VARSCOPE_KEY' HOT 2
- Korean translation HOT 2
- Tutorial 22_Image_Captioning.ipynb is not working in Colab because of disk space limit HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorflow-tutorials.