Teaching Computers to Learn•Interactive notebook lesson•Free
embedding vectors basics
No account is required. Learn the material, try the examples, and mark it complete locally when you are ready to move on.
Embedding vectors for images
Codepython
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inlineCodepython
arr = np.zeros(shape=(7,5))
arrOutput
array([[0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0.]])Codepython
three = arr.copy()
three[1:6, 3] = 255
three[range(1, 6, 2), 1] = 255
three[range(1, 6, 2), 2] = 255
three